Ejemplo n.º 1
0
 public static Task <OperationResult> BranchOnFailureWhenAsync(this OperationResult currentOperationResult, bool condition, AsyncAction branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsFailure && condition,
                  branchAction);
Ejemplo n.º 2
0
 public static Task <OperationResult> BranchOnFailureWhenAsync(this OperationResult currentOperationResult, Predicate condition, AsyncAction <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsFailure && condition.AssertNotNull(nameof(condition))
                  .Invoke(),
                  x => branchAction.AssertNotNull(nameof(branchAction))
                  .Invoke(x.Error));
Ejemplo n.º 3
0
 public static Task <OperationResult <T> > BranchOnFailureWhenAsync <T>(this OperationResult <T> currentOperationResult, AsyncPredicate condition, Action branchAction)
 => currentOperationResult
 .BranchWhenAsync(async x => x.IsFailure && await condition.AssertNotNull(nameof(condition))
                  .Invoke(),
                  branchAction);
Ejemplo n.º 4
0
 public static Task <OperationResult <T> > BranchOnFailureWhenAsync <T>(this OperationResult <T> currentOperationResult, AsyncPredicate <IOperationError> condition, AsyncAction <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhenAsync(async x => x.IsFailure && await condition.AssertNotNull(nameof(condition))
                  .Invoke(x.Error),
                  x => branchAction.AssertNotNull(nameof(branchAction))
                  .Invoke(x.Error));
Ejemplo n.º 5
0
 public static Task <OperationResult <T> > BranchOnSuccessAsync <T>(this OperationResult <T> prevOperationResult, AsyncAction branchAction)
 => prevOperationResult
 .BranchWhenAsync(x => x.IsSuccess,
                  branchAction);
Ejemplo n.º 6
0
 public static Task <OperationResult <T> > BranchOnSuccessAsync <T>(this OperationResult <T> prevOperationResult, AsyncAction <T> branchAction)
 => prevOperationResult
 .BranchWhenAsync(x => x.IsSuccess,
                  x => branchAction.AssertNotNull(nameof(branchAction))
                  .Invoke(x.Value));
Ejemplo n.º 7
0
 public static Task <OperationResult <T> > BranchOnSuccessWhenAsync <T>(this OperationResult <T> currentOperationResult, Predicate condition, AsyncAction <T> branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsSuccess && condition.AssertNotNull(nameof(condition))
                  .Invoke(),
                  x => branchAction.AssertNotNull(nameof(branchAction))
                  .Invoke(x.Value));
Ejemplo n.º 8
0
 public static Task <OperationResult <T> > BranchOnSuccessWhenAsync <T>(this OperationResult <T> currentOperationResult, bool condition, AsyncAction branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsSuccess && condition,
                  branchAction);
Ejemplo n.º 9
0
 public static Task <OperationResult> BranchOnSuccessWhenAsync(this OperationResult currentOperationResult, AsyncPredicate condition, AsyncAction branchAction)
 => currentOperationResult
 .BranchWhenAsync(async x => x.IsSuccess && await condition.AssertNotNull(nameof(condition))
                  .Invoke(),
                  branchAction);
Ejemplo n.º 10
0
 public static Task <OperationResult <T> > BranchOnFailureAsync <T>(this OperationResult <T> currentOperationResult, AsyncAction <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsFailure,
                  x => branchAction.AssertNotNull(nameof(branchAction))
                  .Invoke(x.Error));
Ejemplo n.º 11
0
 public static Task <OperationResult <T> > BranchOnFailureAsync <T>(this OperationResult <T> currentOperationResult, AsyncAction branchAction)
 => currentOperationResult
 .BranchWhenAsync(x => x.IsFailure,
                  branchAction);