Share via


IDbConfigurationInterceptor.Loaded Method

Definition

Occurs during EF initialization after the DbConfiguration has been constructed but just before it is locked ready for use. Use this event to inspect and/or override services that have been registered before the configuration is locked. Note that an interceptor of this type should be used carefully since it may prevent tooling from discovering the same configuration that is used at runtime.

public void Loaded (System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationLoadedEventArgs loadedEventArgs, System.Data.Entity.Infrastructure.Interception.DbConfigurationInterceptionContext interceptionContext);
abstract member Loaded : System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationLoadedEventArgs * System.Data.Entity.Infrastructure.Interception.DbConfigurationInterceptionContext -> unit
Public Sub Loaded (loadedEventArgs As DbConfigurationLoadedEventArgs, interceptionContext As DbConfigurationInterceptionContext)

Parameters

loadedEventArgs
DbConfigurationLoadedEventArgs

Arguments to the event that this interceptor mirrors.

interceptionContext
DbConfigurationInterceptionContext

Contextual information about the event.

Remarks

Handlers can only be added before EF starts to use the configuration and so handlers should generally be added as part of application initialization. Do not access the DbConfiguration static methods inside the handler; instead use the the members of DbConfigurationLoadedEventArgs to get current services and/or add overrides.

Applies to