Search code examples
sqlloggingentity-framework-4entity-framework-4.1trace

In EF 4.1 DbContext how to trace generated SQL


I wonder how to trace generated SQL like DataContext in LinqToSql.

I also read articles about the solution of EFProviderWrapper on Jaroslaw Kowalski's blog, but it is based on ObjectContext, does not work for DbContext.

Anyone know how to do this in DbContext?

Thank you.


Solution

  • The MVC-Mini-Profiler is a pwerful tool, not ony trace generated sql, but also profiling tool.

    Using mvc-mini-profiler database profiling with Entity Framework Code First