Sprache

SaveChangesInterceptor.ThrowingConcurrencyExceptionAsync Methode

Definition

Wird unmittelbar aufgerufen, bevor EF eine DbUpdateConcurrencyException.

public virtual System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ThrowingConcurrencyExceptionAsync(Microsoft.EntityFrameworkCore.Diagnostics.ConcurrencyExceptionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result, System.Threading.CancellationToken cancellationToken = default);
abstract member ThrowingConcurrencyExceptionAsync : Microsoft.EntityFrameworkCore.Diagnostics.ConcurrencyExceptionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
override this.ThrowingConcurrencyExceptionAsync : Microsoft.EntityFrameworkCore.Diagnostics.ConcurrencyExceptionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Overridable Function ThrowingConcurrencyExceptionAsync (eventData As ConcurrencyExceptionEventData, result As InterceptionResult, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult)

Parameter

eventData
ConcurrencyExceptionEventData

Kontextbezogene Informationen zum Parallelitätskonflikt.

result
InterceptionResult

Stellt das aktuelle Ergebnis dar, falls vorhanden. Dieser Wert muss festgelegt true werdenIsSuppressed, wenn ein früherer Interceptor die Ausführung durch Aufrufen Suppress()unterdrückt hat. Dieser Wert wird in der Regel als Rückgabewert für die Implementierung dieser Methode verwendet.

cancellationToken
CancellationToken

A CancellationToken , um zu beobachten, während sie auf den Abschluss der Aufgabe warten.

Gibt zurück

Wenn IsSuppressed ja false, löst EF die Ausnahme aus. Wenn IsSuppressed ja true, löst EF die Ausnahme nicht aus. Eine Implementierung dieser Methode für jeden Interceptor, der nicht versucht, das Festlegen von Eigenschaftswerten zu unterdrücken, muss den result übergebenen Wert zurückgeben.

Implementiert

Gilt für: