ここで本当に単純なものが欠けているように感じます。MVC Miniprofiler をプロジェクトに統合していますが、正しい接続でコンテキストをインスタンス化する方法が見つかりません。これは EF Code First ではなく、モデルが ObjectContext から継承されているためです。私のコードです
public static MyModel GetDataBaseModel()
{
DbConnection conn = new MySqlConnection(Utils.GetConnectionString());
// this returns a DBConnection
DbConnection profiledConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(conn);
//my model needs an EntityConnection, so this is not possible
return new MyModel(profiledConnection);
}
これを解決する方法は?