Table of Contents

Method BeginTransactionAsync

Namespace
MongoDB.EntityFrameworkCore.Storage
Assembly
MongoDB.EntityFrameworkCore.dll

BeginTransactionAsync(CancellationToken)

Asynchronously begins a new transaction.

public Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default)

Parameters

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 created transaction.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.