Class Transaction
Represents a DB instance that has a transaction started, which can be used to carry out inter-related write operations atomically.
TIP: Remember to always call .Dispose() after use or enclose in a 'Using' statement.
public class Transaction : DB, IDisposable
- Inheritance
-
Transaction
- Implements
- Inherited Members
Properties
Session
The client session handle for this transaction instance.
public IClientSessionHandle Session { get; }
Property Value
- IClientSessionHandle
Methods
AbortAsync(CancellationToken)
Aborts and rolls back a transaction
public Task AbortAsync(CancellationToken cancellation = default)
Parameters
cancellationCancellationTokenAn optional cancellation token
Returns
CommitAsync(CancellationToken)
Commits a transaction to MongoDB
public Task CommitAsync(CancellationToken cancellation = default)
Parameters
cancellationCancellationTokenAn optional cancellation token
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()