DbCommandInterceptor Klasa

Definicja

Abstrakcyjna klasa podstawowa do IDbCommandInterceptor użycia podczas implementowania podzestawu metod interfejsu.

public abstract class DbCommandInterceptor : Microsoft.EntityFrameworkCore.Diagnostics.IDbCommandInterceptor, Microsoft.EntityFrameworkCore.Diagnostics.IInterceptor
type DbCommandInterceptor = class
    interface IDbCommandInterceptor
    interface IInterceptor
Public MustInherit Class DbCommandInterceptor
Implements IDbCommandInterceptor, IInterceptor
Dziedziczenie
DbCommandInterceptor
Implementuje

Uwagi

Aby uzyskać więcej informacji i przykładów, zobacz przechwytywanie ef Core .

Konstruktory

DbCommandInterceptor()

Abstrakcyjna klasa podstawowa do IDbCommandInterceptor użycia podczas implementowania podzestawu metod interfejsu.

Metody

CommandCanceled(DbCommand, CommandEndEventData)

Wywoływana, gdy polecenie zostało anulowane.

CommandCanceledAsync(DbCommand, CommandEndEventData, CancellationToken)

Wywoływana, gdy polecenie zostało anulowane.

CommandCreated(CommandEndEventData, DbCommand)

Wywołana natychmiast po wywołaniu CreateCommand()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął tworzenie polecenia w programie CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>). W takim przypadku result jest wynikiem zwracanym przez CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>)element .

CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę CreateCommand().

CommandFailed(DbCommand, CommandErrorEventData)

Wywoływane, gdy wykonanie polecenia nie powiodło się z wyjątkiem.

CommandFailedAsync(DbCommand, CommandErrorEventData, CancellationToken)

Wywoływane, gdy wykonanie polecenia nie powiodło się z wyjątkiem.

CommandInitialized(CommandEndEventData, DbCommand)

Wywoływana po zainicjowaniu CommandText programu EF i inną konfigurację polecenia.

DataReaderClosing(DbCommand, DataReaderClosingEventData, InterceptionResult)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę Close().

DataReaderClosingAsync(DbCommand, DataReaderClosingEventData, InterceptionResult)

Wywoływana tuż przed zamiarem wywołania CloseAsync() programu EF w kontekście asynchronizowym.

DataReaderDisposing(DbCommand, DataReaderDisposingEventData, InterceptionResult)

Wywoływane, gdy wykonanie obiektu DbDataReader ma zostać usunięte.

NonQueryExecuted(DbCommand, CommandExecutedEventData, Int32)

Wywołana natychmiast po wywołaniu ExecuteNonQuery()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>). W takim przypadku result jest wynikiem zwracanym przez NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>)element .

NonQueryExecutedAsync(DbCommand, CommandExecutedEventData, Int32, CancellationToken)

Wywołana natychmiast po wywołaniu ExecuteNonQueryAsync()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken). W takim przypadku result jest wynikiem zwracanym przez NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken)element .

NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteNonQuery().

NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteNonQueryAsync().

ReaderExecuted(DbCommand, CommandExecutedEventData, DbDataReader)

Wywołana natychmiast po wywołaniu ExecuteReader()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>). W takim przypadku result jest wynikiem zwracanym przez ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>)element .

ReaderExecutedAsync(DbCommand, CommandExecutedEventData, DbDataReader, CancellationToken)

Wywołana natychmiast po wywołaniu ExecuteReaderAsync()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken). W takim przypadku result jest wynikiem zwracanym przez ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken)element .

ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteReader().

ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteReaderAsync().

ScalarExecuted(DbCommand, CommandExecutedEventData, Object)

Wywołana natychmiast po wywołaniu ExecuteScalar()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>). W takim przypadku result jest wynikiem zwracanym przez ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>)element .

ScalarExecutedAsync(DbCommand, CommandExecutedEventData, Object, CancellationToken)

Wywołana natychmiast po wywołaniu ExecuteScalarAsync()programu EF .

Ta metoda jest nadal wywoływana, jeśli przechwytujący pominął wykonywanie polecenia w programie ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken). W takim przypadku result jest wynikiem zwracanym przez ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)element .

ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteScalar().

ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken)

Nazwana tuż przed tym, jak EF zamierza wywołać metodę ExecuteScalarAsync().

Dotyczy