public static void ElseFailWith <In>(this SwitchWithInstance <In, Nothing> that, Func <In, Exception> generator) { var els = that.Add(new MatchElse <In, Nothing>( F.ReturnDefault <In, Nothing>(@in => { throw generator(@in); }))); Nothing value; els.TryMatch(out value); }
public static void Else <In>(this SwitchWithInstance <In, Nothing> that, Action <In> result) { var els = that.Add(new MatchElse <In, Nothing>( F.ReturnDefault <In, Nothing>(result))); Nothing value; els.TryMatch(out value); }