【发布时间】:2013-08-13 15:47:39
【问题描述】:
我的 MVC3 应用程序存在一些性能问题。这就是我决定实施迷你分析器的原因。
我将 MVC3 与 EF(和 Razor Views)一起使用。因为我使用的是 DB-first 方法,所以没有 dbo.__MigrationHistory。那么如何让 Mini-Profiler 停止查找呢?
这就是我所做的:
Global.asax.cs:
protected void Application_Start()
{
...
MiniProfilerEF.Initialize();
}
void Application_BeginRequest(object sender, EventArgs e)
{
...
MiniProfiler.Start();
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
我尝试了answer in this Question,但我无法在我的 DBContext (DAL) 中使用“数据库”。
【问题讨论】:
标签: asp.net asp.net-mvc-3 entity-framework mvc-mini-profiler