With linq I have to check if a value of a row is present in an array.
The equivalent of the sql query:
WHERE ID IN (2,3,4,5)
How can I do it?
With linq I have to check if a value of a row is present in an array.
The equivalent of the sql query:
WHERE ID IN (2,3,4,5)
How can I do it?
A very basic example using .Contains()
Intersect and Except are a little more concise and will probably be a bit faster too.
IN
NOT IN
or
Method syntax for IN
and NOT IN