DbCommandInterceptor.NonQueryExecutedAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Se llama inmediatamente después de que EF llame a ExecuteNonQueryAsync().
Se sigue llamando a este método si un interceptor suprimió la ejecución de un comando en NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken).
En este caso, result es el resultado devuelto por NonQueryExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Int32>, CancellationToken).
public virtual System.Threading.Tasks.ValueTask<int> NonQueryExecutedAsync(System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, int result, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<int> NonQueryExecutedAsync(System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, int result, System.Threading.CancellationToken cancellationToken = default);
abstract member NonQueryExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
override this.NonQueryExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
abstract member NonQueryExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
override this.NonQueryExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overridable Function NonQueryExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Integer, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Integer)
Public Overridable Function NonQueryExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Integer, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)
Parámetros
- command
- DbCommand
Comando .
- eventData
- CommandExecutedEventData
Información contextual sobre el comando y la ejecución.
- result
- Int32
Resultado de la llamada a ExecuteNonQueryAsync(). Este valor se usa normalmente como valor devuelto para la implementación de este método.
- cancellationToken
- CancellationToken
Que CancellationToken se debe observar mientras espera a que se complete la tarea.
Devoluciones
Que Task proporciona el resultado que ef usará.
Una implementación normal de este método para cualquier interceptor que no intente cambiar el resultado es devolver el result valor pasado, a menudo usando FromResult<TResult>(TResult)
Implementaciones
Excepciones
CancellationToken Si se cancela .