共用方式為


IRelationalTransactionManager.UseTransactionAsync 方法

定義

多載

UseTransactionAsync(DbTransaction, CancellationToken)

指定要用於資料庫作業的現有 DbTransaction

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

指定要用於資料庫作業的現有 DbTransaction

UseTransactionAsync(DbTransaction, CancellationToken)

來源:
IRelationalTransactionManager.cs
來源:
IRelationalTransactionManager.cs
來源:
IRelationalTransactionManager.cs

指定要用於資料庫作業的現有 DbTransaction

public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> UseTransactionAsync (System.Data.Common.DbTransaction transaction, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction?> UseTransactionAsync (System.Data.Common.DbTransaction? transaction, System.Threading.CancellationToken cancellationToken = default);
abstract member UseTransactionAsync : System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Function UseTransactionAsync (transaction As DbTransaction, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

參數

transaction
DbTransaction

要使用的交易。

cancellationToken
CancellationToken

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

傳回

IDbTransaction 實例,會包裝提供的交易。

例外狀況

適用於

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

來源:
IRelationalTransactionManager.cs
來源:
IRelationalTransactionManager.cs
來源:
IRelationalTransactionManager.cs

指定要用於資料庫作業的現有 DbTransaction

public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> UseTransactionAsync (System.Data.Common.DbTransaction transaction, Guid transactionId, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction?> UseTransactionAsync (System.Data.Common.DbTransaction? transaction, Guid transactionId, System.Threading.CancellationToken cancellationToken = default);
abstract member UseTransactionAsync : System.Data.Common.DbTransaction * Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Function UseTransactionAsync (transaction As DbTransaction, transactionId As Guid, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

參數

transaction
DbTransaction

要使用的交易。

transactionId
Guid

交易的唯一識別碼。

cancellationToken
CancellationToken

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

傳回

IDbTransaction 實例,會包裝提供的交易。

例外狀況

適用於