Jazyk

ISaveChangesInterceptor.SavingChanges Metoda

Definice

Volá se na začátku .DbContext.SaveChanges

public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> SavingChanges(Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);
public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> SavingChanges(Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);
abstract member SavingChanges : Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
override this.SavingChanges : Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
abstract member SavingChanges : Microsoft.EntityFrameworkCore.Diagnostics.DbContextEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
Public Overridable Function SavingChanges (eventData As DbContextEventData, result As InterceptionResult(Of Integer)) As InterceptionResult(Of Integer)
Public Function SavingChanges (eventData As DbContextEventData, result As InterceptionResult(Of Integer)) As InterceptionResult(Of Integer)

Parametry

eventData
DbContextEventData

Kontextové informace o použitém objektu DbContext

result
InterceptionResult<Int32>

Představuje aktuální výsledek, pokud existuje. Tato hodnota bude nastavena HasResult , true pokud některé předchozí zachytávání potlačí provádění voláním SuppressWithResult(TResult). Tato hodnota se obvykle používá jako návratová hodnota pro implementaci této metody.

Návraty

Pokud HasResult je hodnota false, ef bude pokračovat v normálním stavu. Pokud HasResult je pravda, ef potlačí operaci, kterou se chystá provést a použít Result . Implementace této metody pro jakýkoli průsečík, který se nepokouší změnit výsledek, je vrátit result hodnotu předanou.

Platí pro