Beispiel #1
0
 public static OperationResult BranchOnFailureWhen(this OperationResult currentOperationResult, bool condition, Action branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure && condition,
             branchAction);
Beispiel #2
0
 public static OperationResult <T> BranchOnFailureWhen <T>(this OperationResult <T> currentOperationResult, Predicate <IOperationError> condition, Action <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure && condition.AssertNotNull(nameof(condition))
             .Invoke(x.Error),
             x => branchAction.AssertNotNull(nameof(branchAction))
             .Invoke(x.Error));
Beispiel #3
0
 public static OperationResult BranchOnFailureWhen(this OperationResult currentOperationResult, bool condition, Action <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure && condition,
             x => branchAction.AssertNotNull(nameof(branchAction))
             .Invoke(x.Error));
Beispiel #4
0
 public static OperationResult <T> BranchOnFailureWhen <T>(this OperationResult <T> currentOperationResult, Predicate condition, Action branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure && condition.AssertNotNull(nameof(condition))
             .Invoke(),
             branchAction);
Beispiel #5
0
 public static OperationResult <T> BranchOnSuccess <T>(this OperationResult <T> prevOperationResult, Action <T> branchAction)
 => prevOperationResult
 .BranchWhen(x => x.IsSuccess,
             x => branchAction.AssertNotNull(nameof(branchAction))
             .Invoke(x.Value));
Beispiel #6
0
 public static OperationResult BranchOnSuccess(this OperationResult prevOperationResult, Action branchAction)
 => prevOperationResult
 .BranchWhen(x => x.IsSuccess,
             branchAction);
Beispiel #7
0
 public static OperationResult BranchOnSuccessWhen(this OperationResult currentOperationResult, bool condition, Action branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsSuccess && condition,
             branchAction);
Beispiel #8
0
 public static OperationResult <T> BranchOnSuccessWhen <T>(this OperationResult <T> currentOperationResult, Predicate <T> condition, Action <T> branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsSuccess && condition.AssertNotNull(nameof(condition))
             .Invoke(x.Value),
             x => branchAction.AssertNotNull(nameof(branchAction))
             .Invoke(x.Value));
Beispiel #9
0
 public static OperationResult BranchOnSuccessWhen(this OperationResult currentOperationResult, Predicate condition, Action branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsSuccess && condition.AssertNotNull(nameof(condition))
             .Invoke(),
             branchAction);
Beispiel #10
0
 public static OperationResult BranchOnFailure(this OperationResult currentOperationResult, Action branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure,
             branchAction);
Beispiel #11
0
 public static OperationResult <T> BranchOnFailure <T>(this OperationResult <T> currentOperationResult, Action <IOperationError> branchAction)
 => currentOperationResult
 .BranchWhen(x => x.IsFailure,
             x => branchAction.AssertNotNull(nameof(branchAction))
             .Invoke(x.Error));