IDbConfigurationInterceptor 接口

定义

可以在实体框架加载应用程序的 时向 注册 DbInterception 实现此接口的对象 DbConfiguration,以接收通知。

public interface IDbConfigurationInterceptor : System.Data.Entity.Infrastructure.Interception.IDbInterceptor
type IDbConfigurationInterceptor = interface
    interface IDbInterceptor
Public Interface IDbConfigurationInterceptor
Implements IDbInterceptor
派生
实现

注解

还可以在应用程序的配置文件中注册侦听器。 有关 Entity Framework 配置的详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=260883 。

方法

Loaded(DbConfigurationLoadedEventArgs, DbConfigurationInterceptionContext)

在 EF 初始化期间,在 DbConfiguration 构造 之后,但在锁定可供使用之前发生。 使用此事件可以检查和/或替代在配置锁定之前已注册的服务。 请注意,应谨慎使用此类型的侦听器,因为它可能会阻止工具发现运行时使用的相同配置。

适用于