Freigeben über


IDbConnectionInterceptor.ConnectionDisposingAsync Methode

Definition

Wird kurz aufgerufen, bevor EF in einem asynchronen Kontext aufrufen DisposeAsync() möchte.

public virtual System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult> ConnectionDisposingAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult result);
abstract member ConnectionDisposingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
override this.ConnectionDisposingAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult>
Public Overridable Function ConnectionDisposingAsync (connection As DbConnection, eventData As ConnectionEventData, result As InterceptionResult) As ValueTask(Of InterceptionResult)

Parameter

connection
DbConnection

Die Verbindung.

eventData
ConnectionEventData

Kontextbezogene Informationen zur Verbindung.

result
InterceptionResult

Stellt das aktuelle Ergebnis dar, sofern vorhanden. Dieser Wert wird auf true festgelegt, wenn ein vorheriger Interceptor die Ausführung durch Aufrufen Suppress()von unterdrückt hatIsSuppressed. Dieser Wert wird in der Regel als Rückgabewert für die Implementierung dieser Methode verwendet.

Gibt zurück

Wenn IsSuppressed ist false, wird EF wie gewohnt fortgesetzt. trueWenn IsSuppressed ist, unterdrückt EF den Vorgang, der ausgeführt werden soll. Eine Implementierung dieser Methode für jeden Interceptor, der nicht versucht, den Vorgang zu unterdrücken, besteht darin, den result übergebenen Wert zurückzugeben.

Gilt für: