共用方式為


DbTransactionInterceptor.TransactionFailedAsync 方法

定義

使用 DbTransaction 失敗時呼叫 ,但發生例外狀況。

public virtual System.Threading.Tasks.Task TransactionFailedAsync (System.Data.Common.DbTransaction transaction, Microsoft.EntityFrameworkCore.Diagnostics.TransactionErrorEventData eventData, System.Threading.CancellationToken cancellationToken = default);
abstract member TransactionFailedAsync : System.Data.Common.DbTransaction * Microsoft.EntityFrameworkCore.Diagnostics.TransactionErrorEventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.TransactionFailedAsync : System.Data.Common.DbTransaction * Microsoft.EntityFrameworkCore.Diagnostics.TransactionErrorEventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function TransactionFailedAsync (transaction As DbTransaction, eventData As TransactionErrorEventData, Optional cancellationToken As CancellationToken = Nothing) As Task

參數

transaction
DbTransaction

異動。

eventData
TransactionErrorEventData

連線和交易的相關內容資訊。

cancellationToken
CancellationToken

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

傳回

代表非同步作業的 Task

實作

例外狀況

適用於