IDbCommandInterceptor.ScalarExecutedAsync 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 llamar a EF.ExecuteScalarAsync()
public System.Threading.Tasks.Task<object> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<object> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.ValueTask<object?> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<object?> ScalarExecutedAsync (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result, System.Threading.CancellationToken cancellationToken = default);
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
abstract member ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
override this.ScalarExecutedAsync : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
Public Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Public Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)
Public Overridable Function ScalarExecutedAsync (command As DbCommand, eventData As CommandExecutedEventData, result As Object, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)
Parámetros
- command
- DbCommand
El comando.
- eventData
- CommandExecutedEventData
Información contextual sobre el comando y la ejecución.
- result
- Object
Resultado de la llamada a ExecuteScalarAsync(). Este valor se usa normalmente como valor devuelto para la implementación de este método.
- cancellationToken
- CancellationToken
Que CancellationToken se debe observar mientras se espera a que se complete la tarea.
Devoluciones
Que Task proporciona el resultado que EF 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
Si se cancela CancellationToken.
Comentarios
Se sigue llamando a este método si un interceptor suprimió la ejecución de un comando en ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken). En este caso, result
es el resultado devuelto por ScalarExecutingAsync(DbCommand, CommandEventData, InterceptionResult<Object>, CancellationToken).