Compartilhar via


RelationalDatabaseFacadeExtensions.UseTransactionAsync Método

Definição

Sobrecargas

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

Define o DbTransaction a ser usado por operações de banco de dados no DbContext.

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

Define o DbTransaction a ser usado por operações de banco de dados no DbContext.

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs

Define o DbTransaction a ser usado por operações de banco de dados no 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)

Parâmetros

databaseFacade
DatabaseFacade

O DatabaseFacade para o contexto.

transaction
DbTransaction

O DbTransaction a ser usado.

cancellationToken
CancellationToken

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

Retornos

Um Task que contém o IDbContextTransaction para a transação fornecida.

Exceções

Se o padrão CancellationToken for cancelado.

Comentários

Consulte Transações no EF Core para obter mais informações e exemplos.

Aplica-se a

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs
Origem:
RelationalDatabaseFacadeExtensions.cs

Define o DbTransaction a ser usado por operações de banco de dados no 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)

Parâmetros

databaseFacade
DatabaseFacade

O DatabaseFacade para o contexto.

transaction
DbTransaction

O DbTransaction a ser usado.

transactionId
Guid

O identificador exclusivo para a transação.

cancellationToken
CancellationToken

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

Retornos

Um Task que contém o IDbContextTransaction para a transação fornecida.

Exceções

Se o padrão CancellationToken for cancelado.

Comentários

Consulte Transações no EF Core para obter mais informações e exemplos.

Aplica-se a