I am trying to write a module to append a comment containing useful information to every Linq2Entities
SQL query emitted by an entity framework DbContext
(the information will be used in debugging).
Using Linq2Sql
, I had previously accomplished this via extending the MvcMiniProfiler ProfiledDbCommand
command class. However, I can't get the same approach to work with EF/DbContext. I've extending EFProfiledDbCommand
, but that doesn't work. Indeed, even a straight use of EFProfiledDbCommand
doesn't work: I get the error
Unable to determine the provider name for connection of type 'MvcMiniProfiler.Data.EFProfiledDbConnection'.
Can anyone supply either workaround for my current solution or an alternate approach to this problem?