Table of Contents

Class AsyncDbTransaction

Namespace
LinqToDB.Async
Assembly
linq2db.dll

Basic IAsyncDbTransaction implementation with fallback to synchronous operations if corresponding functionality missing from DbTransaction.

public class AsyncDbTransaction : IAsyncDbTransaction, IDisposable, IAsyncDisposable
Inheritance
AsyncDbTransaction
Implements
Extension Methods

Constructors

AsyncDbTransaction(DbTransaction)

protected AsyncDbTransaction(DbTransaction transaction)

Parameters

transaction DbTransaction

Properties

Transaction

Gets underlying transaction instance.

public DbTransaction Transaction { get; }

Property Value

DbTransaction

Methods

Commit()

Commits the database transaction.

public virtual void Commit()

CommitAsync(CancellationToken)

Commits transaction asynchronously.

public virtual Task CommitAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Asynchronous operation completion task.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public virtual Task DisposeAsync()

Returns

Task

Rollback()

Rolls back a transaction from a pending state.

public virtual void Rollback()

RollbackAsync(CancellationToken)

Rollbacks transaction asynchronously.

public virtual Task RollbackAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Asynchronous operation completion task.