如何使用实体框架4.1的mvc-mini-profiler [英] How do you use the mvc-mini-profiler with Entity Framework 4.1
问题描述
无法确定连接类型为MvcMiniProfiler的提供程序名称。 Data.ProfiledDbConnection'
下面是我用来尝试和调整我的上下文的代码。
DbConnection conn = new MySqlConnection(
ConfigurationManager.ConnectionStrings [ConnString]。ConnectionString);
var profiledConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(conn);
返回新的DB(profiledConnection);
这里是数据库上下文类。
public class DB:DbContext,Stats.Data.IDB
{
public DB(DbConnection conn)
:base(conn,true)
{
} ...
从版本1.5开始,现在可以看到: http:// code。 google.com/p/mvc-mini-profiler
配置步骤如下:使用实体框架代码首先使用mvc-mini-profiler数据库分析
I am trying to use the mvc-mini-profiler with MVC3 and keep getting the following error
Unable to determine the provider name for connection of type 'MvcMiniProfiler.Data.ProfiledDbConnection'
Below is the code that I am using to try and instatiate my Context.
DbConnection conn = new MySqlConnection(
ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString);
var profiledConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(conn);
return new DB(profiledConnection);
And here is the DB Context Class.
public class DB:DbContext, Stats.Data.IDB
{
public DB(DbConnection conn)
: base(conn, true)
{
}...
As of version 1.5 this is now supported see: http://code.google.com/p/mvc-mini-profiler
The step to configure it are listed here: Using mvc-mini-profiler database profiling with Entity Framework Code First
这篇关于如何使用实体框架4.1的mvc-mini-profiler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!