How to configure mvc mini profiler with Linq to SQL?
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 for some queries but on other queries I find null reference exception. When I attached the source code to debug I found out that internal void AddSqlTiming(SqlTiming stats) { Head.AddSqlTiming(stats); } Head Property in above method is null in MiniProfiler.cs at line 198. Any idea why? EDIT: Following method returns me the datacontext object public static EvoletDataContext Get() { var connection = ProfiledDbConnection.Get(new