0
私は次のように私は私のApp_Code/DataClasses.designer.cs
にこれを追加することがthe documentation saysASP.netミニプロファイラLINQからSQLへ
としてミニプロファイラでLINQツーSQLを記録するために取得しようとしている:
public MainContext() :
base(global::System.Configuration.ConfigurationManager.ConnectionStrings["ScirraConnectionString"].ConnectionString, mappingSource)
{
OnCreated();
}
// Code I'm adding in for the mini profiler
partial class DBContext
{
public static DBContext Get()
{
var conn = new MvcMiniProfiler.Data.ProfiledDbConnection(GetConnection(), MiniProfiler.Current);
return new DBContext(conn);
}
}
を
しかし、それはエラーがスローされます。
The name 'GetConnection' does not exist in the current context
私はこれも試してみた:
partial class DBContext
{
public static DBContext Get()
{
var conn = ProfiledDbConnection.Get(new System.Data.SqlClient.SqlConnection(global::System.Configuration.ConfigurationManager.ConnectionStrings["ScirraConnectionString"].ConnectionString));
return new DBContext(conn);
}
}
を
しかし、それは
'MvcMiniProfiler.Data.ProfiledDbConnection' does not contain a definition for 'Get'
を投げる私はHow can I make the ASP.NET MVC mini profiler work with Linq 2 SQL?に参照さましたが、そこでのソリューションのどれも私のために働くように見えるん。
誰でも私にそれをlinq-to-SQLのために働かせる方法を教えてもらえますか?
new ProfiledDbConnection(...)
ので、代わりのあなたは、コンストラクタを使用する必要があり、静的ゲッター:これに...
ProfiledDbConnection.Get(...)
に
:
あなたはナゲットを使用していますか、最新のソースですか? –
@samはい私はナゲットを使用しました。私は非常に最近、 –
バイナリをダウンロードしましたあなたは新しいProfiledDbConnection(cnn、MiniProfiler.Current)を試しましたか? –