DbConnectionInterceptor.ConnectionClosing Methode

Definition

Wird kurz aufgerufen, bevor EF aufrufen Close()möchte.

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

Parameter

connection
DbConnection

Die Verbindung.

eventData
ConnectionEventData

Kontextinformationen zur Verbindung.

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.

Gibt zurück

Wenn IsSuppressed false ist, wird die EF wie gewohnt fortgesetzt. Wenn IsSuppressed true ist, unterdrückt EF den Vorgang, den er ausführen wollte. Eine normale Implementierung dieser Methode für jeden Interceptor, der nicht versucht, den Vorgang zu unterdrücken, besteht darin, den result übergebenen Wert zurückzugeben.

Implementiert

Gilt für: