Compartilhar via


RelationalConnection.UseTransactionAsync Método

Definição

Sobrecargas

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Especifica um existente DbTransaction a ser usado para operações de banco de dados.

UseTransactionAsync(DbTransaction, CancellationToken)

Especifica um existente DbTransaction a ser usado para operações de banco de dados.

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Especifica um existente DbTransaction a ser usado para operações de banco de dados.

public virtual System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> UseTransactionAsync (System.Data.Common.DbTransaction transaction, Guid transactionId, System.Threading.CancellationToken cancellationToken = default);
public virtual 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>
override this.UseTransactionAsync : System.Data.Common.DbTransaction * Guid * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Overridable Function UseTransactionAsync (transaction As DbTransaction, transactionId As Guid, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

Parâmetros

transaction
DbTransaction

A transação a ser usada.

transactionId
Guid

O identificador exclusivo para a transação.

cancellationToken
CancellationToken

Um CancellationToken a ser observado enquanto aguarda a conclusão da tarefa.

Retornos

Uma instância do IDbTransaction que encapsula a transação fornecida.

Implementações

Exceções

Se o padrão CancellationToken for cancelado.

Aplica-se a

UseTransactionAsync(DbTransaction, CancellationToken)

Especifica um existente DbTransaction a ser usado para operações de banco de dados.

public virtual System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction> UseTransactionAsync (System.Data.Common.DbTransaction transaction, System.Threading.CancellationToken cancellationToken = default);
public virtual 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>
override this.UseTransactionAsync : System.Data.Common.DbTransaction * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction>
Public Overridable Function UseTransactionAsync (transaction As DbTransaction, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDbContextTransaction)

Parâmetros

transaction
DbTransaction

A transação a ser usada.

cancellationToken
CancellationToken

Um CancellationToken a ser observado enquanto aguarda a conclusão da tarefa.

Retornos

Uma instância do IDbTransaction que encapsula a transação fornecida.

Implementações

Exceções

Se o padrão CancellationToken for cancelado.

Aplica-se a