switch新的用法
List<Object> list = new List<object>(); list.Add(0); list.Add(new List<int>() { 2, 4, 6 }); list.Add(null);List<Object> list = new List<object>(); list.Add(0); list.Add(new List<int>() { 2, 4, 6 }); list.Add(null); list.Add(11); foreach (var item in list) { switch (item) { case 0: break; case IEnumerable<int> test: break; case int n when n > 2: break; case null: break; default: break; } } list.Add(11); foreach (var item in list) { switch (item) { case 0: break; case IEnumerable<int> test: break; case int n when n > 2: break; case null: break; default: break; } }