Table of Contents

Interface IInterceptor

Namespace
Microsoft.EntityFrameworkCore.Diagnostics
Assembly
Microsoft.EntityFrameworkCore.dll

The base interface for all Entity Framework interceptors.

public interface IInterceptor

Remarks

Interceptors can be used to view, change, or suppress operations taken by Entity Framework. See the specific implementations of this interface for details. For example, 'IDbCommandInterceptor'.

Use AddInterceptors(params IInterceptor[]) to register application interceptors.

Extensions can also register multiple IInterceptors in the internal service provider. If both injected and application interceptors are found, then the injected interceptors are run in the order that they are resolved from the service provider, and then the application interceptors are run in the order that they were added to the context.

See EF Core interceptors for more information and examples.