1
メタデータを持つ通常のEF接続文字列であるエンティティフレームワークedmxの接続文字列がありました。なぜメタデータのない接続文字列が機能するのですか?
私はmvc-mini-profilerを実装しており、コンテキストを作成するために以下のメソッドを書きました。私は単にSQL接続文字列を使用していますが、EF接続文字列を使用していません。
今では動作しますが、私はそれが今見つけることができれば、それは、なぜ、メタデータ(.csdl、.ssdlアドレス)を取得しているか興味があります「新しいコンテキスト()」
public static T GetProfiledContext<T>() where T : ObjectContext
{
// create connection
var sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);
// wrap the connection with a profiling connection that tracks timings
var profiledDbConnection = MvcMiniProfiler.Data.ProfiledDbConnection.Get(sqlConnection, MiniProfiler.Current);
// create context
return profiledDbConnection.CreateObjectContext<T>();
}