public static void Default <TCase, TOther>(this SwithCase <TCase, TOther> sc, TOther other) { if (sc == null) { return; } sc.Action(other); }
public static SwithCase <TCase, TOther> Case <TCase, TOther>(this SwithCase <TCase, TOther> sc, Predicate <TCase> predict, TOther other, bool bBreak) where TCase : IEquatable <TCase> { if (sc == null) { return(null); } if (predict(sc.Value)) { sc.Action(other); return(bBreak ? null : sc); } else { return(sc); } }