Compartilhar via


IDbCommandInterceptor.ReaderExecutedAsync Método

Definição

Chamado imediatamente após o EF chamar ExecuteReaderAsync().

public 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 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);
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>
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>
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 Function ReaderExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As DbDataReader, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DbDataReader)
Public Function ReaderExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As DbDataReader, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbDataReader)
Public Overridable Function ReaderExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As DbDataReader, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbDataReader)

Parâmetros

command
DbCommand

O comando.

eventData
CommandExecutedEventData

Informações contextuais sobre o comando e a execução.

result
DbDataReader

O resultado da chamada para ExecuteReaderAsync(). Esse valor normalmente é usado como o valor retornado para a implementação desse método.

cancellationToken
CancellationToken

Um CancellationToken a ser observado enquanto aguarda a conclusão da tarefa.

Retornos

Um Task que fornece o resultado que o EF usará. Uma implementação desse método para qualquer interceptador que não está tentando alterar o resultado é retornar o result valor passado, muitas vezes usando FromResult<TResult>(TResult)

Exceções

Se o padrão CancellationToken for cancelado.

Comentários

Esse método ainda será chamado se um interceptador suprimiu a execução de um comando em ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken). Nesse caso, result é o resultado retornado por ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken).

Aplica-se a