How to configure mvc mini profiler with Linq to SQL?

后端 未结 2 1774
南旧
南旧 2020-12-12 03:12

I have configured mini profiler with asp.net mvc application. I also want to profile my db so I hooked it with L2S datacontext as in this example.

It is working fine

相关标签:
2条回答
  • 2020-12-12 03:35

    This used to happen if you had a ProfiledDbConnection in play and the actual profiler was set to null.

    In general we avoid serving our internal consumers a ProfiledDbConnection if the current request is not profiled ... this means everything is just a bit faster.

    Unfortunately, this can be sometimes tricky to do with EF and L2S. To overcome this I just checked in a change that allows you to use the Profiling bespoke objects even if no profiler is in play.

    Nonetheless, my recommendation remains that you should be using raw connections where possible when you are not profiling.

    0 讨论(0)
  • 2020-12-12 03:53

    Looks like this issue has finally been fixed in the latest commit:

    https://github.com/SamSaffron/MiniProfiler/commit/bcea578dd47d7f9ccf1f495cf67c360cdece5f2a

    0 讨论(0)
提交回复
热议问题