IDbCommandInterceptor.ReaderExecutedAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Chiamato immediatamente dopo le chiamate ExecuteReaderAsync()EF .
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)
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 verrà usato da EF.
Un'implementazione di questo metodo per qualsiasi intercettatore che non tenta di modificare il risultato consiste nel restituire il result
valore passato, spesso usando FromResult<TResult>(TResult)
Eccezioni
Se CancellationToken viene annullato.
Commenti
Questo metodo viene ancora chiamato se un intercettatore 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).