3

可能重复:
如何使 ASP.NET MVC mini profiler 与 Linq 2 SQL 一起工作?

这可能与如何使 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 文件,但它永远不会被调用。我需要做什么才能让它被调用?

4

1 回答 1

-1

你可以从这里下载一个样本,看看你做错了什么。尝试使用 nuget 安装迷你分析器,这样您就不会错过任何步骤

于 2011-07-08T15:55:31.077 回答