SaveChangesInterceptor Klasa

Definicja

Abstrakcyjna klasa bazowa do ISaveChangesInterceptor użycia podczas implementowania podzestawu metod interfejsu.

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

Uwagi

Aby uzyskać więcej informacji i przykłady, zobacz przechwytywanie technologii EF Core .

Konstruktory

SaveChangesInterceptor()

Abstrakcyjna klasa bazowa do ISaveChangesInterceptor użycia podczas implementowania podzestawu metod interfejsu.

Metody

SaveChangesCanceled(DbContextEventData)

Wywoływana, gdy DbContext.SaveChanges została anulowana.

SaveChangesCanceledAsync(DbContextEventData, CancellationToken)

Wywoływana, gdy DbContext.SaveChangesAsync została anulowana.

SaveChangesFailed(DbContextErrorEventData)

Wywoływana, gdy w elemecie DbContext.SaveChangeszostał zgłoszony wyjątek .

SaveChangesFailedAsync(DbContextErrorEventData, CancellationToken)

Wywoływana, gdy w elemecie DbContext.SaveChangesAsynczostał zgłoszony wyjątek .

SavedChanges(SaveChangesCompletedEventData, Int32)

Wywołana na końcu .DbContext.SaveChanges

Ta metoda jest nadal wywoływana, jeśli przechwytywanie pomija tworzenie polecenia w programie SavingChanges(DbContextEventData, InterceptionResult<Int32>). W tym przypadku result wynik jest zwracany przez SavingChanges(DbContextEventData, InterceptionResult<Int32>).

SavedChangesAsync(SaveChangesCompletedEventData, Int32, CancellationToken)

Wywołana na końcu .DbContext.SaveChangesAsync

Ta metoda jest nadal wywoływana, jeśli przechwytywanie pomija tworzenie polecenia w programie SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken). W tym przypadku result wynik jest zwracany przez SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken).

SavingChanges(DbContextEventData, InterceptionResult<Int32>)

Wywołana na początku .DbContext.SaveChanges

SavingChangesAsync(DbContextEventData, InterceptionResult<Int32>, CancellationToken)

Wywołana na początku .DbContext.SaveChangesAsync

ThrowingConcurrencyException(ConcurrencyExceptionEventData, InterceptionResult)

Wywoływana bezpośrednio przed zgłoszeniem DbUpdateConcurrencyExceptionprzez EF .

ThrowingConcurrencyExceptionAsync(ConcurrencyExceptionEventData, InterceptionResult, CancellationToken)

Wywoływana bezpośrednio przed zgłoszeniem DbUpdateConcurrencyExceptionprzez EF .

Dotyczy