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
Perform the equivalent of an SQL IN with IEnumerable.Contains().
var idlist = new int[] { 2, 3, 4, 5 }; var result = from x in source where idlist.Contains(x.Id) select x;