DbCommandInterceptor.ReaderExecutedAsync Method

Definition

Called immediately after EF calls ExecuteReaderAsync().

This method is still called if an interceptor suppressed execution of a command in ReaderExecutingAsync(DbCommand, CommandEventData, InterceptionResult<DbDataReader>, CancellationToken). In this case, result is the result returned by 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)

Parameters

command
DbCommand

The command.

eventData
CommandExecutedEventData

Contextual information about the command and execution.

result
DbDataReader

The result of the call to ExecuteReaderAsync(). This value is typically used as the return value for the implementation of this method.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A Task providing the result that EF will use. A normal implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in, often using FromResult<TResult>(TResult)

Implements

Exceptions

Applies to