DbConfiguration.Loaded イベント
[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]
EF の初期化中に、DbConfiguration が構築された後、使用できるようにロックされる直前に発生します。
名前空間: System.Data.Entity
アセンブリ: EntityFramework (EntityFramework.dll 内)
構文
'宣言
Public Shared Event Loaded As EventHandler(Of DbConfigurationLoadedEventArgs)
'使用
Dim handler As EventHandler(Of DbConfigurationLoadedEventArgs)
AddHandler DbConfiguration.Loaded, handler
public static event EventHandler<DbConfigurationLoadedEventArgs> Loaded
public:
static event EventHandler<DbConfigurationLoadedEventArgs^>^ Loaded {
void add (EventHandler<DbConfigurationLoadedEventArgs^>^ value);
void remove (EventHandler<DbConfigurationLoadedEventArgs^>^ value);
}
member Loaded : IEvent<EventHandler<DbConfigurationLoadedEventArgs>,
DbConfigurationLoadedEventArgs>
JScript supports the use of events, but not the declaration of new ones.
解説
ハンドラーは EF で構成の使用が開始される前にのみ追加できるため、一般に、ハンドラーはアプリケーションの初期化の一環として追加する必要があります。 ハンドラー内の DbConfiguration 静的メソッドにはアクセスしないでください。現在のサービスを取得したりオーバーライドを追加したりするには、代わりに DbConfigurationLoadedEventArgs のメンバーを使用してください。