共用方式為


IRelationalCommandDiagnosticsLogger.CommandCanceledAsync 方法

定義

CommandCanceled事件的記錄。

public System.Threading.Tasks.Task CommandCanceledAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, DateTimeOffset startTime, TimeSpan duration, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource, System.Threading.CancellationToken cancellationToken = default);
abstract member CommandCanceledAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * DateTimeOffset * TimeSpan * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function CommandCanceledAsync (connection As IRelationalConnection, command As DbCommand, context As DbContext, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, startTime As DateTimeOffset, duration As TimeSpan, commandSource As CommandSource, Optional cancellationToken As CancellationToken = Nothing) As Task

參數

connection
IRelationalConnection

連接。

command
DbCommand

資料庫命令物件。

context
DbContext

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

executeMethod
DbCommandMethod

表示將呼叫以執行命令的方法。

commandId
Guid

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

connectionId
Guid

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

startTime
DateTimeOffset

開始執行的時間。

duration
TimeSpan

在引發例外狀況之前所經過的時間量。

commandSource
CommandSource

命令的來源。

cancellationToken
CancellationToken

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

傳回

Task 表示非同步作業。

例外狀況

適用於