RelationalLoggerExtensions.CommandErrorAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
CommandError事件的日志。
public static System.Threading.Tasks.Task CommandErrorAsync (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, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
static member CommandErrorAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function CommandErrorAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), 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, Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- diagnostics
- IDiagnosticsLogger<DbLoggerCategory.Database.Command>
要使用的诊断记录器。
- connection
- IRelationalConnection
连接。
- command
- DbCommand
数据库命令对象。
- executeMethod
- DbCommandMethod
表示将调用以执行命令的方法。
- connectionId
- Guid
与正在使用的 DbConnection 关联的关联 ID。
- exception
- Exception
导致此失败的异常。
- startTime
- DateTimeOffset
执行开始的时间。
- duration
- TimeSpan
引发异常之前所经过的时间量。
- cancellationToken
- CancellationToken
取消标记。
返回
表示 Task 异步操作的 。