Class EntityScopeExtensions
public static class EntityScopeExtensions
- Inheritance
-
EntityScopeExtensions
- Inherited Members
Methods
ExecuteAsync<T, TKey>(EntityScope<T, TKey>, Func<T, Task<T>>, Action<Exception>)
Backwards-compatible overload — pass an Action<T> to handle
errors thrown by func only; commit-side exceptions still propagate.
New code should prefer the LockableErrorKind overload, which routes every
failure path through a single callback.
public static Task<T> ExecuteAsync<T, TKey>(this EntityScope<T, TKey> item, Func<T, Task<T>> func, Action<Exception> errorHandler) where T : LockableEntityBase<TKey>
Parameters
itemEntityScope<T, TKey>funcFunc<T, Task<T>>errorHandlerAction<Exception>
Returns
- Task<T>
Type Parameters
TTKey
ExecuteAsync<T, TKey>(EntityScope<T, TKey>, Func<T, Task<T>>, Action<LockableErrorKind, Exception>)
The provided function should return an entity for commit and default for abandon. If this is a delete operation, return the entity to be deleted from 'func'.
public static Task<T> ExecuteAsync<T, TKey>(this EntityScope<T, TKey> item, Func<T, Task<T>> func, Action<LockableErrorKind, Exception> errorHandler = null) where T : LockableEntityBase<TKey>
Parameters
itemEntityScope<T, TKey>The entity scope.
funcFunc<T, Task<T>>The function to be executed within the scope.
errorHandlerAction<LockableErrorKind, Exception>Receives a LockableErrorKind discriminator and the exception for every failure path — errors thrown by
funcas well as commit-side exceptions (LockExpiredException, LockAlreadyReleasedException, CommitException, any other commit failure). Whennull(default), the original exception propagates with its stack trace intact — same behavior as before this overload existed.
Returns
- Task<T>
Type Parameters
TType of the entity.
TKeyType of the key.