这可能与如何使 ASP.NET MVC mini profiler 与 Linq 2 SQL 一起工作?,但该问题中的任何答案都不适合我。
我正在使用 DBML 文件 (WebData.dbml) 及其支持的 WebData.cs 文件作为我网站的模型。我添加了normanthesquid的代码
public static WebDataContext CreateNewContext()
{
var sqlConnection = new WebDataContext().Connection;
var profiledConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(sqlConnection);
return new WebDataContext(profiledConnection);
}
到 WebData.designer.cs 文件,但它永远不会被调用。我需要做什么才能让它被调用?