Exemplo n.º 1
0
 public static IPhaseResult <TMapped> Map <TResult, TMapped>(
     this IPhaseResult <TResult> source,
     Func <TResult, TMapped> onFinalValue)
 {
     return(source switch
     {
         Finished <TResult> finished => onFinalValue(finished.Value).AsFinished(),
         Cancelled <TResult> => PhaseResult.NeedsRetry <TMapped>(),
         NeedsRetry <TResult> => PhaseResult.NeedsRetry <TMapped>(),
         _ => throw new Exception()
     });
Exemplo n.º 2
0
 public static PipeResult <TDone, TNotDone> FromPhaseResult <TDone, TNotDone>(this IPhaseResult phaseResult) =>
 phaseResult switch
 {