Compartilhar via


RelationalLoggerExtensions.CommandNonQueryExecutedAsync Método

Definição

Logs do CommandExecuted evento.

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

Parâmetros

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

O agente diagnóstico a ser usado.

connection
IRelationalConnection

A conexão.

command
DbCommand

O objeto de comando do banco de dados.

context
DbContext

O DbContext que está sendo usado no momento, para nulo, se não for conhecido.

commandId
Guid

A ID de correlação associada ao determinado DbCommand.

connectionId
Guid

A ID de correlação associada ao DbConnection que está sendo usado.

methodResult
Int32

O valor retornado da execução do método subjacente.

startTime
DateTimeOffset

A hora em que a execução começou.

duration
TimeSpan

A duração da execução do comando, não incluindo o consumo de resultados.

cancellationToken
CancellationToken

O token de cancelamento.

Retornos

O resultado da execução, que pode ter sido modificado por um interceptador.

Aplica-se a