Sprache

IDbConnectionInterceptor.ConnectionOpening Methode

Definition

Wird gerade vor EF aufgerufen, um den Anruf zu tätigen Open().

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

Parameter

connection
DbConnection

Die Verbindung.

eventData
ConnectionEventData

Kontextbezogene Informationen zur Verbindung.

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.

Gibt zurück

Wenn IsSuppressed ja false, wird EF normal fortgesetzt. Wenn IsSuppressed ja true, unterdrückt EF den Vorgang, den er auszuführen hatte. 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: