In sql, I can make an if statement like the following If MY_STATE in (1,2,3,4)
In C# I have to type if(MY_STATE == STATE.CT || MY_STATE == STATE.MA || MY_STATE == ST
You could write your own extension method to do that:
static bool IsOneOf(this T value, params T[] set)
{
return set.Contains(value);
}
Usage: MY_STATE.IsOneOf(STATE_A, STATE_B, STATE_C)
(It's slower at runtime, though. It has to create a temporary array and all parameters to IsOneOf have to be evaluated)