We use Dapper and EF in our store, and Dapper is extremely useful when debugging queries on the SQL server when something went wrong. Instead of simply representing the original SQL, we created a thin decorator that also adds some contextual information (source) as an SQL comment, something like
SELECT * FROM Order WHERE orderId > 123
This allows our database administrators and developers to quickly and quickly find the source of the problem if we have errors in the database that are erroneous or lead to performance impacts (we have hundreds of thousands of database calls per day, so one bad request may cause quite some damage).
We would also like to do this with EF. This does not have to be a SQL comment, but some kind of hook for the delivery of meta information that is sent with a call. Any idea, is this possible?
thank you for your advice
Philipp
c # sql sql-server entity-framework instrumentation
Philipp sumi
source share