Ejemplo n.º 1
0
 public virtual IOutcome <TNextFailure, TValue> OtherwiseFail <TNextFailure>(Func <TCause, TNextFailure> action)
     where TNextFailure : Exception
 => Success.Of <TNextFailure, TValue>(value);
Ejemplo n.º 2
0
 public virtual IOutcome <TNextFailure, TNextSuccess> OtherwiseTo <TNextFailure, TNextSuccess>(Func <TCause, IOutcome <TNextFailure, TNextSuccess> > action) where TNextFailure : Exception
 {
     return(Success.Of <TNextFailure, TNextSuccess>((TNextSuccess)(object)value));
 }
Ejemplo n.º 3
0
 public virtual IOutcome <TCause, Tuple <TValue, TSecondSuccess> > AlongWith <TOtherFailure, TSecondSuccess>(IOutcome <TOtherFailure, TSecondSuccess> outcome) where TOtherFailure : Exception
 {
     return(outcome.AndThenTo(
                secondOutcome => Success.Of <TCause, Tuple <TValue, TSecondSuccess> >(Tuple.Create(value, secondOutcome))));
 }
Ejemplo n.º 4
0
 public virtual IOutcome <TCause, TNextSuccess> AndThen <TNextSuccess>(Func <TValue, TNextSuccess> action)
 {
     return(Success.Of <TCause, TNextSuccess>(action.Invoke(value)));
 }
Ejemplo n.º 5
0
 public virtual IOutcome <TCause, TValue> Otherwise(Func <TCause, TValue> action)
 {
     return(Success.Of <TCause, TValue>(action.Invoke(cause)));
 }