public static OperationResult ContinueOnSuccessWhen(this OperationResult prevOperationResult, bool condition, Func <OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsSuccess && condition,
               nextOperation);
 public static OperationResult ContinueOnSuccessWhen(this OperationResult prevOperationResult, Predicate condition, Func <OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsSuccess && condition.AssertNotNull(nameof(condition))
               .Invoke(),
               nextOperation);
 public static OperationResult <T> ContinueOnSuccessWhen <T>(this OperationResult <T> prevOperationResult, Predicate <T> condition, Func <T, OperationResult <T> > nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsSuccess && condition.AssertNotNull(nameof(condition))
               .Invoke(prevOperationResult.Value),
               x => nextOperation.AssertNotNull(nameof(nextOperation))
               .Invoke(prevOperationResult.Value));
 public static OperationResult ContinueOnFailureWhen(this OperationResult prevOperationResult, bool condition, Func <OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure && condition,
               nextOperation);
 public static OperationResult <T> ContinueOnFailureWhen <T>(this OperationResult <T> prevOperationResult, Predicate <IOperationError> condition, Func <IOperationError, OperationResult <T> > nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure && condition.AssertNotNull(nameof(condition))
               .Invoke(x.Error),
               x => nextOperation.AssertNotNull(nameof(nextOperation))
               .Invoke(x.Error));
 public static OperationResult ContinueOnFailureWhen(this OperationResult prevOperationResult, bool condition, Func <IOperationError, OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure && condition,
               x => nextOperation.AssertNotNull(nameof(nextOperation))
               .Invoke(x.Error));
 public static OperationResult <T> ContinueOnFailureWhen <T>(this OperationResult <T> prevOperationResult, Predicate condition, Func <OperationResult <T> > nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure && condition.AssertNotNull(nameof(condition))
               .Invoke(),
               nextOperation);
예제 #8
0
 public static OperationResult <T> ContinueOnFailure <T>(this OperationResult <T> prevOperationResult, Func <object, OperationResult <T> > recoveryOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure,
               x => recoveryOperation.AssertNotNull(nameof(recoveryOperation))
               .Invoke(prevOperationResult.Error));
예제 #9
0
 public static OperationResult ContinueOnFailure(this OperationResult prevOperationResult, Func <OperationResult> recoveryOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsFailure,
               recoveryOperation);
예제 #10
0
 public static OperationResult <T> ContinueWhen <T>(this OperationResult <T> prevOperationResult, Predicate <OperationResult <T> > condition, Func <OperationResult <T>, OperationResult <T> > nextOperation)
 => prevOperationResult
 .ContinueWhen(
     condition.AssertNotNull(nameof(condition))
     .Invoke(prevOperationResult.AssertNotNull(nameof(prevOperationResult))),
     nextOperation);
예제 #11
0
 public static async Task <OperationResult <T> > ContinueWhenAsync <T>(this OperationResult <T> prevOperationResult, AsyncPredicate <OperationResult <T> > condition, Func <OperationResult <T> > nextOperation)
 => prevOperationResult
 .ContinueWhen(
     await condition.AssertNotNull(nameof(condition))
     .Invoke(prevOperationResult.AssertNotNull(nameof(prevOperationResult))),
     nextOperation);
예제 #12
0
 public static async Task <OperationResult> ContinueWhenAsync(this OperationResult prevOperationResult, AsyncPredicate condition, Func <OperationResult, OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(
     await condition.AssertNotNull(nameof(condition))
     .Invoke(),
     nextOperation);
 public static OperationResult ContinueOnSuccess(this OperationResult prevOperationResult, Func <OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsSuccess,
               nextOperation);
 public static OperationResult ContinueOnSuccess <TPrev>(this OperationResult <TPrev> prevOperationResult, Func <TPrev, OperationResult> nextOperation)
 => prevOperationResult
 .ContinueWhen(x => x.IsSuccess,
               x => nextOperation.AssertNotNull(nameof(nextOperation))
               .Invoke(prevOperationResult.Value));