Lingua

DbCommandInterceptor Classe

Definizione

Classe base astratta per l'uso quando IDbCommandInterceptor si implementa un subset dei metodi di interfaccia.

[System.Runtime.CompilerServices.Nullable(0)]
public abstract class DbCommandInterceptor : Microsoft.EntityFrameworkCore.Diagnostics.IDbCommandInterceptor, Microsoft.EntityFrameworkCore.Diagnostics.IInterceptor
public abstract class DbCommandInterceptor : Microsoft.EntityFrameworkCore.Diagnostics.IDbCommandInterceptor, Microsoft.EntityFrameworkCore.Diagnostics.IInterceptor
[<System.Runtime.CompilerServices.Nullable(0)>]
type DbCommandInterceptor = class
    interface IDbCommandInterceptor
    interface IInterceptor
type DbCommandInterceptor = class
    interface IDbCommandInterceptor
    interface IInterceptor
Public MustInherit Class DbCommandInterceptor
Implements IDbCommandInterceptor, IInterceptor
Ereditarietà
DbCommandInterceptor
Attributi
Implementazioni

Commenti

Per altre informazioni ed esempi, vedere Intercettori di EF Core .

Costruttori

Nome Descrizione
DbCommandInterceptor()

Classe base astratta per l'uso quando IDbCommandInterceptor si implementa un subset dei metodi di interfaccia.

Metodi

Nome Descrizione
CommandCanceled(DbCommand, CommandEndEventData)

Chiamato quando un comando è stato annullato.

CommandCanceledAsync(DbCommand, CommandEndEventData, CancellationToken)

Chiamato quando un comando è stato annullato.

CommandCreated(CommandEndEventData, DbCommand)

Chiamato immediatamente dopo che EF chiama CreateCommand().

Questo metodo viene comunque chiamato se un intercettore ha eliminato la creazione di un comando in CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>). In questo caso, result è il risultato restituito da CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>).

CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>)

Chiamato appena prima di EF intende chiamare CreateCommand().

CommandFailed(DbCommand, CommandErrorEventData)

Chiamato quando l'esecuzione di un comando non è riuscita con un'eccezione.

CommandFailedAsync(DbCommand, CommandErrorEventData, CancellationToken)

Chiamato quando l'esecuzione di un comando non è riuscita con un'eccezione.

CommandInitialized(CommandEndEventData, DbCommand)

Chiamato dopo l'inizializzazione di Entity Framework e altre configurazioni CommandText dei comandi.

DataReaderClosing(DbCommand, DataReaderClosingEventData, InterceptionResult)

Chiamato appena prima di EF intende chiamare Close().

DataReaderClosingAsync(DbCommand, DataReaderClosingEventData, InterceptionResult)

Chiamato subito prima che EF intenda chiamare CloseAsync() in un contesto asincrono.

DataReaderDisposing(DbCommand, DataReaderDisposingEventData, InterceptionResult)

Chiamato quando l'esecuzione di un oggetto DbDataReader sta per essere eliminata.

NonQueryExecuted(DbCommand, CommandExecutedEventData, Int32)

Chiamato immediatamente dopo che EF chiama ExecuteNonQuery().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>). In questo caso, result è il risultato restituito da NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>).

NonQueryExecutedAsync(DbCommand, CommandExecutedEventData, Int32, CancellationToken)

Chiamato immediatamente dopo che EF chiama ExecuteNonQueryAsync().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken). In questo caso, result è il risultato restituito da NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken).

NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>)

Chiamato appena prima di EF intende chiamare ExecuteNonQuery().

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

Chiamato appena prima di EF intende chiamare ExecuteNonQueryAsync().

ReaderExecuted(DbCommand, CommandExecutedEventData, DbDataReader)

Chiamato immediatamente dopo che EF chiama ExecuteReader().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>). In questo caso, result è il risultato restituito da ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>).

ReaderExecutedAsync(DbCommand, CommandExecutedEventData, DbDataReader, CancellationToken)

Chiamato immediatamente dopo che EF chiama ExecuteReaderAsync().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken). In questo caso, result è il risultato restituito da ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken).

ReaderExecuting(DbCommand, CommandEventData, InterceptionResult<DbDataReader>)

Chiamato appena prima di EF intende chiamare ExecuteReader().

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

Chiamato appena prima di EF intende chiamare ExecuteReaderAsync().

ScalarExecuted(DbCommand, CommandExecutedEventData, Object)

Chiamato immediatamente dopo che EF chiama ExecuteScalar().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>). In questo caso, result è il risultato restituito da ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>).

ScalarExecutedAsync(DbCommand, CommandExecutedEventData, Object, CancellationToken)

Chiamato immediatamente dopo che EF chiama ExecuteScalarAsync().

Questo metodo viene comunque chiamato se un intercettore ha eliminato l'esecuzione di un comando in ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken). In questo caso, result è il risultato restituito da ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken).

ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>)

Chiamato appena prima di EF intende chiamare ExecuteScalar().

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

Chiamato appena prima di EF intende chiamare ExecuteScalarAsync().

Si applica a