Table of Contents

Class EntityScope<T, TKey>

Namespace
Tharga.MongoDB.Lockable
Assembly
Tharga.MongoDB.dll
public record EntityScope<T, TKey> : IAsyncDisposable, IDisposable, IEquatable<EntityScope<T, TKey>> where T : LockableEntityBase<TKey>

Type Parameters

T
TKey
Inheritance
EntityScope<T, TKey>
Implements
Derived
Inherited Members
Extension Methods

Properties

Entity

public T Entity { get; }

Property Value

T

Methods

AbandonAsync()

Releases the lock without any changes to the entity.

public Task AbandonAsync()

Returns

Task

CommitAsync(T)

Saves updates back to the database and release the lock.

public Task<T> CommitAsync(T updatedEntity = null)

Parameters

updatedEntity T

Returns

Task<T>

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.

SetErrorStateAsync(Exception)

Sets an exception on the lock.

public Task SetErrorStateAsync(Exception exception)

Parameters

exception Exception

Returns

Task