Language

DbConfiguration.SetHistoryContext メソッド

定義

DbConfigurationから派生したクラスのコンストラクターからこのメソッドを呼び出して、明示的なファクトリ セットを持たないDbMigrationsConfigurationに対して、指定されたプロバイダーに対してカスタマイズされたHistoryContextを作成できるFunc<T1,T2,TResult> デリゲートを設定します。

protected internal void SetHistoryContext(string providerInvariantName, Func<System.Data.Common.DbConnection,string,System.Data.Entity.Migrations.History.HistoryContext> factory);
member this.SetHistoryContext : string * Func<System.Data.Common.DbConnection, string, System.Data.Entity.Migrations.History.HistoryContext> -> unit
Protected Friend Sub SetHistoryContext (providerInvariantName As String, factory As Func(Of DbConnection, String, HistoryContext))

パラメーター

providerInvariantName
String

このジェネレーターを使用する ADO.NET プロバイダーの不変名。

factory
Func<DbConnection,String,HistoryContext>

特定のDbConnectionHistoryContextインスタンスを作成し、既定のスキーマを表すStringファクトリ。

注釈

このメソッドは、Entity Framework に構成を追加するための便利で検出可能な方法として提供されます。 内部的には、AddDependencyResolver を使用して Func<T1,T2,TResult>に適切なリゾルバーを追加するのと同じ方法で動作します。 これは、必要に応じて、制御の反転コンテナーによってサポートされるカスタム 競合回避モジュールまたはリゾルバーを使用して同じ機能を実現できることを意味します。

適用対象