Поделиться через


RelationalLoggerExtensions.CommandScalarExecutingAsync Метод

Определение

Регистрирует CommandExecuting событие.

public static System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object>> CommandScalarExecutingAsync (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<object>> CommandScalarExecutingAsync (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 CommandScalarExecutingAsync : 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<obj>>
static member CommandScalarExecutingAsync : 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<obj>>
<Extension()>
Public Function CommandScalarExecutingAsync (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 Object))
<Extension()>
Public Function CommandScalarExecutingAsync (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 Object))

Параметры

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

Используемое средство ведения журнала диагностика.

connection
IRelationalConnection

Соединение.

command
DbCommand

Объект команды базы данных.

context
DbContext

Объект , используемый DbContext в данный момент, для значения NULL, если он неизвестен.

commandId
Guid

Идентификатор корреляции, связанный с заданным DbCommandобъектом .

connectionId
Guid

Идентификатор корреляции, связанный с используемым DbConnection объектом .

startTime
DateTimeOffset

Время начала выполнения.

cancellationToken
CancellationToken

Токен отмены.

Возвращаемое значение

Перехваченный результат.

Применяется к