Class EntityScope<T, TKey>
public record EntityScope<T, TKey> : IAsyncDisposable, IDisposable, IEquatable<EntityScope<T, TKey>> where T : LockableEntityBase<TKey>
Type Parameters
TTKey
- Inheritance
-
EntityScope<T, TKey>
- Implements
-
IEquatable<EntityScope<T, TKey>>
- 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
CommitAsync(T)
Saves updates back to the database and release the lock.
public Task<T> CommitAsync(T updatedEntity = null)
Parameters
updatedEntityT
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
exceptionException