共用方式為


IRelationalCommandDiagnosticsLogger.CommandScalarExecutingAsync 方法

定義

CommandExecuting事件的記錄。

public System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object>> CommandScalarExecutingAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Guid commandId, Guid connectionId, DateTimeOffset startTime, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource, System.Threading.CancellationToken cancellationToken = default);
abstract member CommandScalarExecutingAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * DateTimeOffset * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>>
Public Function CommandScalarExecutingAsync (connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset, commandSource As CommandSource, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of InterceptionResult(Of Object))

參數

connection
IRelationalConnection

連接。

command
DbCommand

資料庫命令物件。

context
DbContext

DbContext目前使用的 ,如果不知道,則為 null。

commandId
Guid

與指定 DbCommand 相關聯的相互關聯識別碼。

connectionId
Guid

DbConnection 所使用 關聯的相互關聯識別碼。

startTime
DateTimeOffset

開始執行的時間。

commandSource
CommandSource

命令的來源。

cancellationToken
CancellationToken

等候 CancellationToken 工作完成時要觀察的 。

傳回

攔截的結果。

例外狀況

適用於