DbConfiguration.AddInterceptor Method (IDbInterceptor)

 

Registers an IDbInterceptor at application startup. Note that interceptors can also be added and removed at any time using DbInterception.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

protected internal void AddInterceptor(
	IDbInterceptor interceptor
)

Parameters

interceptor
Type: System.Data.Entity.Infrastructure.Interception.IDbInterceptor

The interceptor to register.

This method is provided as a convenient and discoverable way to add configuration to the Entity Framework. Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for IDbInterceptor. This means that, if desired, the same functionality can be achieved using a custom resolver or a resolver backed by an Inversion-of-Control container.