Compartir a través de


RelationalLoggerExtensions.CommandNonQueryExecutingAsync Método

Definición

Registra el CommandExecuting evento.

public static System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>> CommandNonQueryExecutingAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>> CommandNonQueryExecutingAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, System.Threading.CancellationToken cancellationToken = default);
static member CommandNonQueryExecutingAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * DateTimeOffset * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>>
static member CommandNonQueryExecutingAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * DateTimeOffset * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>>
<Extension()>
Public Function CommandNonQueryExecutingAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InterceptionResult(Of Integer))
<Extension()>
Public Function CommandNonQueryExecutingAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult(Of Integer))

Parámetros

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

Registrador de diagnóstico que se va a usar.

connection
IRelationalConnection

La conexión.

command
DbCommand

Objeto de comando de base de datos.

context
DbContext

Objeto DbContext que se está usando actualmente, en null si no se conoce.

commandId
Guid

Identificador de correlación asociado al especificado DbCommand.

connectionId
Guid

Identificador de correlación asociado al DbConnection objeto que se usa.

startTime
DateTimeOffset

Hora en que comenzó la ejecución.

cancellationToken
CancellationToken

Token de cancelación.

Devoluciones

Resultado interceptado.

Se aplica a