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?
It appears the answer is in the comment by @Giorgio: How do you use the mvc-mini-profiler with Entity Framework 4.1 and Using mvc-mini-profiler database profiling with Entity Framework Code First and is most easily solved by adding MiniProfiler.EF
NuGet package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With