IRelationalCommandDiagnosticsLogger.CommandErrorAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
CommandError事件的日志。
public System.Threading.Tasks.Task CommandErrorAsync (Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, DateTimeOffset startTime, TimeSpan duration, Microsoft.EntityFrameworkCore.Diagnostics.CommandSource commandSource, System.Threading.CancellationToken cancellationToken = default);
abstract member CommandErrorAsync : Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * DateTimeOffset * TimeSpan * Microsoft.EntityFrameworkCore.Diagnostics.CommandSource * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function CommandErrorAsync (connection As IRelationalConnection, command As DbCommand, context As DbContext, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, exception As Exception, startTime As DateTimeOffset, duration As TimeSpan, commandSource As CommandSource, Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- connection
- IRelationalConnection
连接。
- command
- DbCommand
数据库命令对象。
- executeMethod
- DbCommandMethod
表示将调用以执行命令的方法。
- connectionId
- Guid
与正在使用的 DbConnection 关联的关联 ID。
- exception
- Exception
导致此失败的异常。
- startTime
- DateTimeOffset
执行开始的时间。
- duration
- TimeSpan
引发异常之前所经过的时间量。
- commandSource
- CommandSource
命令的源。
- cancellationToken
- CancellationToken
等待 CancellationToken 任务完成时要观察的 。
返回
表示 Task 异步操作的 。