Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }