Table of Contents

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

databaseFacade DatabaseFacade

The DatabaseFacade for the context.

transactionOptions TransactionOptions

The MongoDB.Driver.TransactionOptions that control the behavior of this transaction.

cancellationToken CancellationToken

A 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.