Method BeginTransactionAsync
- Namespace
- MongoDB.EntityFrameworkCore
- Assembly
- MongoDB.EntityFrameworkCore.dll
BeginTransactionAsync(DatabaseFacade, TransactionOptions, CancellationToken)
Begin a new async transaction with the supplied transactionOptions.
public static Task<IDbContextTransaction> BeginTransactionAsync(this DatabaseFacade databaseFacade, TransactionOptions transactionOptions, CancellationToken cancellationToken = default)
Parameters
databaseFacadeDatabaseFacadeThe DatabaseFacade for the context.
transactionOptionsTransactionOptionsThe MongoDB.Driver.TransactionOptions that control the behavior of this transaction.
cancellationTokenCancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task<IDbContextTransaction>
A task that represents the asynchronous operation. The task result contains the newly begun IDbContextTransaction.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.