RelationalLoggerExtensions.TransactionErrorAsync 方法

定义

TransactionError事件的日志。

public static System.Threading.Tasks.Task TransactionErrorAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbTransaction transaction, Guid transactionId, string action, Exception exception, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
static member TransactionErrorAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbTransaction * Guid * string * Exception * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function TransactionErrorAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connection As IRelationalConnection, transaction As DbTransaction, transactionId As Guid, action As String, exception As Exception, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

transaction
DbTransaction

事务。

transactionId
Guid

与 关联的 DbTransaction关联 ID。

action
String

正在执行的操作。

exception
Exception

表示错误的异常。

startTime
DateTimeOffset

开始操作的时间。

duration
TimeSpan

从开始操作开始的已用时间。

cancellationToken
CancellationToken

等待 CancellationToken 任务完成时要观察的 。

返回

表示 Task 异步操作的 。

例外

适用于