Delen via


IRelationalTransactionManager.UseTransactionAsync Method

Definition

Overloads

UseTransactionAsync(DbTransaction, CancellationToken)

Specifies an existing DbTransaction to be used for database operations.

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Specifies an existing DbTransaction to be used for database operations.

UseTransactionAsync(DbTransaction, CancellationToken)

Source:
IRelationalTransactionManager.cs
Source:
IRelationalTransactionManager.cs
Source:
IRelationalTransactionManager.cs

Specifies an existing DbTransaction to be used for database operations.

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)

Parameters

transaction
DbTransaction

The transaction to be used.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

An instance of IDbTransaction that wraps the provided transaction.

Exceptions

Applies to

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Source:
IRelationalTransactionManager.cs
Source:
IRelationalTransactionManager.cs
Source:
IRelationalTransactionManager.cs

Specifies an existing DbTransaction to be used for database operations.

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)

Parameters

transaction
DbTransaction

The transaction to be used.

transactionId
Guid

The unique identifier for the transaction.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

An instance of IDbTransaction that wraps the provided transaction.

Exceptions

Applies to