private static void PatternMatchingDemo() { PatternMatching patternMatching = new PatternMatching(); // patternMatching.PatternMatchingForIs(DayOfWeek.Friday); var value = new List <DayOfWeek>() { DayOfWeek.Monday, DayOfWeek.Friday }; // var value = new List<int>() { 1, 2, 3 }; patternMatching.PatternMatchingGenericForIs <DayOfWeek>(value); }
private static void PatternMatchingDemo2() { PatternMatching patternMatching = new PatternMatching(); patternMatching.PatternMatchingSwitch(new List <object>() { 10, -1, 5, new Person("Tom", 40), "abc", new Person("Joe", 10), null, }); }