Class AsyncDbTransaction
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
Methods
Commit()
Commits the database transaction.
public virtual void Commit()
CommitAsync(CancellationToken)
Commits transaction asynchronously.
public virtual Task CommitAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenAsynchronous 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
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
CancellationTokenAsynchronous operation cancellation token.
Returns
- Task
Asynchronous operation completion task.