3
我有一個現在使用MvcMiniProfiler的Asp.net Mvc 3應用程序。我還使用實體框架來訪問我的數據庫,並且我想啓用分析器來處理實體模型。到目前爲止,我已經創建了下面的上下文工廠:用MvcMiniProfiler剖析實體框架
internal class ProfiledContextFactory : IContextFactory
{
public ModelContainer GetContext()
{
var conn = ProfiledDbConnection.Get(GetConnection());
return ObjectContextUtils.CreateObjectContext<ModelContainer>(conn);
}
private static EntityConnection GetConnection()
{
return new EntityConnection(ConfigurationManager.ConnectionStrings["ModelContainer"].ConnectionString);
}
}
當我運行上面的代碼,這是我的倉庫層,當我開始工作的單位叫時,它會調用CreateDbCommandDefinition時滯留在infite循環在MvcMiniProfiler.ProfiledDbServices類中。
任何線索我做錯了什麼?