Condividi tramite


DbCommandInterceptor.ReaderExecutedAsync Metodo

Definizione

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).

public virtual System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ReaderExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, System.Data.Common.DbDataReader result, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<System.Data.Common.DbDataReader> ReaderExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, System.Data.Common.DbDataReader result, System.Threading.CancellationToken cancellationToken = default);
abstract member ReaderExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * System.Data.Common.DbDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
override this.ReaderExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * System.Data.Common.DbDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
abstract member ReaderExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * System.Data.Common.DbDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbDataReader>
override this.ReaderExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * System.Data.Common.DbDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbDataReader>
Public Overridable Function ReaderExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As DbDataReader, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DbDataReader)
Public Overridable Function ReaderExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As DbDataReader, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbDataReader)

Parametri

command
DbCommand

Comando.

eventData
CommandExecutedEventData

Informazioni contestuali sul comando e sull'esecuzione.

result
DbDataReader

Risultato della chiamata a ExecuteReaderAsync(). Questo valore viene in genere usato come valore restituito per l'implementazione di questo metodo.

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Oggetto Task che fornisce il risultato che ef userà. Un'implementazione normale di questo metodo per qualsiasi intercettore che non tenta di modificare il risultato consiste nel restituire il result valore passato, spesso utilizzando FromResult<TResult>(TResult)

Implementazioni

Eccezioni

Si applica a