共用方式為


RelationalDatabaseFacadeExtensions.UseTransactionAsync 方法

定義

多載

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

DbTransaction設定 上 DbContext 資料庫作業要使用的 。

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

DbTransaction設定 上 DbContext 資料庫作業要使用的 。

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs

DbTransaction設定 上 DbContext 資料庫作業要使用的 。

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

參數

databaseFacade
DatabaseFacade

DatabaseFacade內容的 。

transaction
DbTransaction

要使用的 DbTransaction

cancellationToken
CancellationToken

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

傳回

Task 包含 IDbContextTransaction 指定交易的 。

例外狀況

備註

如需詳細資訊和範例,請參閱 EF Core 中的交易

適用於

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs
來源:
RelationalDatabaseFacadeExtensions.cs

DbTransaction設定 上 DbContext 資料庫作業要使用的 。

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

參數

databaseFacade
DatabaseFacade

DatabaseFacade內容的 。

transaction
DbTransaction

要使用的 DbTransaction

transactionId
Guid

交易的唯一識別碼。

cancellationToken
CancellationToken

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

傳回

Task 包含 IDbContextTransaction 指定交易的 。

例外狀況

備註

如需詳細資訊和範例,請參閱 EF Core 中的交易

適用於