Condividi tramite


RelationalDatabaseFacadeExtensions.UseTransactionAsync Metodo

Definizione

Overload

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

Imposta l'oggetto DbTransaction da utilizzare dalle operazioni del database in DbContext.

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

Imposta l'oggetto DbTransaction da utilizzare dalle operazioni del database in DbContext.

UseTransactionAsync(DatabaseFacade, DbTransaction, CancellationToken)

Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs

Imposta l'oggetto DbTransaction da utilizzare dalle operazioni del database in 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)

Parametri

databaseFacade
DatabaseFacade

Oggetto DatabaseFacade per il contesto.

transaction
DbTransaction

Oggetto DbTransaction da usare.

cancellationToken
CancellationToken

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

Restituisce

Oggetto Task contenente l'oggetto IDbContextTransaction per la transazione specificata.

Eccezioni

Commenti

Per altre informazioni ed esempi , vedere Transazioni in EF Core .

Si applica a

UseTransactionAsync(DatabaseFacade, DbTransaction, Guid, CancellationToken)

Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs
Origine:
RelationalDatabaseFacadeExtensions.cs

Imposta l'oggetto DbTransaction da utilizzare dalle operazioni del database in 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)

Parametri

databaseFacade
DatabaseFacade

Oggetto DatabaseFacade per il contesto.

transaction
DbTransaction

Oggetto DbTransaction da usare.

transactionId
Guid

Identificatore univoco per la transazione.

cancellationToken
CancellationToken

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

Restituisce

Oggetto Task contenente l'oggetto IDbContextTransaction per la transazione specificata.

Eccezioni

Commenti

Per altre informazioni ed esempi , vedere Transazioni in EF Core .

Si applica a