IDbCommandInterceptor.CommandCreating Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Wird gerade vor EF aufgerufen, um den Anruf zu tätigen CreateCommand().
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating(Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> result);
public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> CommandCreating(Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> result);
abstract member CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
override this.CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
abstract member CommandCreating : Microsoft.EntityFrameworkCore.Diagnostics.CommandCorrelatedEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<System.Data.Common.DbCommand>
Public Overridable Function CommandCreating (eventData As CommandCorrelatedEventData, result As InterceptionResult(Of DbCommand)) As InterceptionResult(Of DbCommand)
Public Function CommandCreating (eventData As CommandCorrelatedEventData, result As InterceptionResult(Of DbCommand)) As InterceptionResult(Of DbCommand)
Parameter
- eventData
- CommandCorrelatedEventData
Kontextbezogene Informationen zum Befehl und zur Ausführung.
- result
- InterceptionResult<DbCommand>
Stellt das aktuelle Ergebnis dar, falls vorhanden.
Dieser Wert muss festgelegt true werdenHasResult, wenn ein früherer Interceptor die Ausführung durch Aufrufen SuppressWithResult(TResult)unterdrückt hat.
Dieser Wert wird in der Regel als Rückgabewert für die Implementierung dieser Methode verwendet.
Gibt zurück
Ist HasResult "false", wird der EF normal fortgesetzt.
Wenn HasResult "true" ist, unterdrückt EF den Vorgang, den er stattdessen ausführen und verwenden Result wollte.
Eine Implementierung dieser Methode für jeden Interceptor, der nicht versucht, das Ergebnis zu ändern, besteht darin, den result übergebenen Wert zurückzugeben.