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 want to use Contains, which maps onto the SQL IN. I'm assuming State is an enum and stored as an integer.
var states = new int[] { (int)State.CT, (int)State.MA, (int)State.VA, (int)State.RI }; var query = db.States.Where( s => states.Contains( s.State ) );