ISaveChangesInterceptor.ThrowingConcurrencyExceptionAsync Methode

Definition

Wird unmittelbar aufgerufen, bevor EF einen DbUpdateConcurrencyExceptionauslöst.

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

Kontextinformationen zum Parallelitätskonflikt.

result
InterceptionResult

Stellt das aktuelle Ergebnis dar, sofern eines vorhanden ist. Dieser Wert ist IsSuppressed auf true festgelegt, wenn ein vorheriger Interceptor die Ausführung unterdrückt hat, indem er aufruft Suppress(). Dieser Wert wird in der Regel als Rückgabewert für die Implementierung dieser Methode verwendet.

cancellationToken
CancellationToken

Ein CancellationToken , der beim Warten auf den Abschluss der Aufgabe zu beobachten ist.

Gibt zurück

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

Ausnahmen

Gilt für: