In .net (c# or vb) expressions, how would you implement SQL\'s handy IN() functionality?
i.e. value in (1, 2, 4, 7)
rather than:
value = 1 or value =
If you will do many lookups on the same dataset it is good from a performance perspective to use HashSet.
HashSet
HashSet numbers = new HashSet { 1, 2, 4, 7 }; bool is5inSet = numbers.Contains(5);