Condividi tramite


RelationalConnection.UseTransactionAsync Metodo

Definizione

Overload

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Specifica un oggetto esistente DbTransaction da utilizzare per le operazioni del database.

UseTransactionAsync(DbTransaction, CancellationToken)

Specifica un oggetto esistente DbTransaction da utilizzare per le operazioni del database.

UseTransactionAsync(DbTransaction, Guid, CancellationToken)

Specifica un oggetto esistente DbTransaction da utilizzare per le operazioni del database.

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)

Parametri

transaction
DbTransaction

Transazione da utilizzare.

transactionId
Guid

Identificatore univoco per la transazione.

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Istanza di IDbTransaction che esegue il wrapping della transazione specificata.

Implementazioni

Eccezioni

Si applica a

UseTransactionAsync(DbTransaction, CancellationToken)

Specifica un oggetto esistente DbTransaction da utilizzare per le operazioni del database.

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)

Parametri

transaction
DbTransaction

Transazione da utilizzare.

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Istanza di IDbTransaction che esegue il wrapping della transazione specificata.

Implementazioni

Eccezioni

Si applica a