Compartir a través de


IDbCommandInterceptor.NonQueryExecutedAsync Método

Definición

Se llama inmediatamente después de que EF llame a ExecuteNonQueryAsync().

public System.Threading.Tasks.Task<int> NonQueryExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, int result, System.Threading.CancellationToken cancellationToken = default);
public 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.ValueTask<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.Task<int>
abstract member 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.ValueTask<int>
override this.NonQueryExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
Public Function NonQueryExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Integer, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)
Public 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 ValueTask(Of Integer)

Parámetros

command
DbCommand

El 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 va a observar mientras espera a que se complete la tarea.

Devoluciones

Que Task proporciona el resultado que EF va a usar. Una implementación 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)

Excepciones

Comentarios

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

Se aplica a