Share via


SaveChangesInterceptor Class

Definition

Abstract base class for ISaveChangesInterceptor for use when implementing a subset of the interface methods.

public abstract class SaveChangesInterceptor : Microsoft.EntityFrameworkCore.Diagnostics.ISaveChangesInterceptor
type SaveChangesInterceptor = class
    interface ISaveChangesInterceptor
    interface IInterceptor
Public MustInherit Class SaveChangesInterceptor
Implements ISaveChangesInterceptor
Inheritance
SaveChangesInterceptor
Implements

Remarks

See EF Core interceptors for more information and examples.

Constructors

SaveChangesInterceptor()

Methods

SaveChangesCanceled(DbContextEventData)

Called when DbContext.SaveChanges was canceled.

SaveChangesCanceledAsync(DbContextEventData, CancellationToken)

Called when DbContext.SaveChangesAsync was canceled.

SaveChangesFailed(DbContextErrorEventData)

Called when an exception has been thrown in DbContext.SaveChanges.

SaveChangesFailedAsync(DbContextErrorEventData, CancellationToken)

Called when an exception has been thrown in DbContext.SaveChangesAsync.

SavedChanges(SaveChangesCompletedEventData, Int32)

Called at the end of DbContext.SaveChanges.

This method is still called if an interceptor suppressed creation of a command in SavingChanges(DbContextEventData, InterceptionResult<Int32>). In this case, result is the result returned by SavingChanges(DbContextEventData, InterceptionResult<Int32>).

SavedChangesAsync(SaveChangesCompletedEventData, Int32, CancellationToken)

Called at the end of DbContext.SaveChangesAsync.

This method is still called if an interceptor suppressed creation of a command in SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken). In this case, result is the result returned by SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken).

SavingChanges(DbContextEventData, InterceptionResult<Int32>)

Called at the start of DbContext.SaveChanges.

SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken)

Called at the start of DbContext.SaveChangesAsync.

ThrowingConcurrencyException(ConcurrencyExceptionEventData, InterceptionResult)

Called immediately before EF is going to throw a DbUpdateConcurrencyException.

ThrowingConcurrencyExceptionAsync(ConcurrencyExceptionEventData, InterceptionResult, CancellationToken)

Called immediately before EF is going to throw a DbUpdateConcurrencyException.

Applies to