In Entity Framework Core the TagWith feature is useful as it allows us to add arbitrary messages which will get outputted along with queries if we have query logging enabled.
And from Entity Framework Core 6 preview 6 there is a new TagWith overload which will automatically include the filename and the line number along with the query.
A simple example is below…