asp.net-mvc - MVC-mini-profiler 和 Linq-2-SQL

标签 asp.net-mvc linq-to-sql mvc-mini-profiler

<分区>

Possible Duplicate:
How can I make the ASP.NET MVC mini profiler work with Linq 2 SQL?

这可能是 How can I make the ASP.NET MVC mini profiler work with 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 文件,但它永远不会被调用。我需要做什么才能让它被调用?

最佳答案

您可以从 here 下载示例看看你做错了什么。尝试使用 nuget 安装 mini profiler,这样你就不会错过任何一步

关于asp.net-mvc - MVC-mini-profiler 和 Linq-2-SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6625996/

相关文章:

asp.net-mvc - 将 MVC 应用程序发布到 Azure 失败,出现 ERROR_NOT_SUPPORTED 错误

c# - 忽略空值的 Linq 搜索

c# - 使用 LIST INSERT 到存储过程

linq-to-sql - LINQ : Specified cast is not valid occurs intermittedly

asp.net-mvc - 使用 MvcMiniProfiler 分析 Entity Framework

c# - 将 MVC mini-profiler 时间安排到异步任务中

c# - Bootstrap 模态对话框不会出现在屏幕中央

asp.net-mvc - 使用 Thinktecture IdentityServer 的联合安全性

c# - 我正在尝试通过 C# 调用操作结果方法

mvc-mini-profiler - 让 mvc-mini-profiler 向所有用户显示一些数据