Table of Contents

Class CloudStorageDbContextTransaction

Namespace
CloudStorageORM.Infrastructure
Assembly
CloudStorageORM.dll

Transaction wrapper used by CloudStorageTransactionManager.

public sealed class CloudStorageDbContextTransaction : IDbContextTransaction, IDisposable, IAsyncDisposable
Inheritance
CloudStorageDbContextTransaction
Implements
Inherited Members

Constructors

CloudStorageDbContextTransaction(CloudStorageTransactionManager)

Transaction wrapper used by CloudStorageTransactionManager.

public CloudStorageDbContextTransaction(CloudStorageTransactionManager transactionManager)

Parameters

transactionManager CloudStorageTransactionManager

Properties

TransactionId

Gets the transaction identifier.

public Guid TransactionId { get; }

Property Value

Guid

Remarks

See Transactions in EF Core for more information and examples.

Methods

Commit()

Commits all changes made to the database in the current transaction.

public void Commit()

Remarks

See Transactions in EF Core for more information and examples.

CommitAsync(CancellationToken)

Commits all changes made to the database in the current transaction asynchronously.

public Task CommitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task

A Task representing the asynchronous operation.

Remarks

See Transactions in EF Core for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

Dispose()

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

public void Dispose()

DisposeAsync()

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

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

Rollback()

Discards all changes made to the database in the current transaction.

public void Rollback()

Remarks

See Transactions in EF Core for more information and examples.

RollbackAsync(CancellationToken)

Discards all changes made to the database in the current transaction asynchronously.

public Task RollbackAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task

A Task representing the asynchronous operation.

Remarks

See Transactions in EF Core for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.