Is there a shorter way of writing something like this:
if(x==1 || x==2 || x==3) // do something
Wha
public static bool In(this T x, params T[] set) { return set.Contains(x); } ... if (x.In(1, 2, 3)) { ... }
Required reading: MSDN Extension methods