I want to know if at least one element in a first list can be found in a second list.
I can see two ways to do it. Let\'s say our lists are:
List<
The accepted answer is great, however it does not work with Linq-to-sql, since there's no mapping for Intersect. In that case you should use :
Intersect
bool isFound = table.Any(row => list2.Contains(row.FieldWithValue));
This gets compiled to WHERE EXSITS
WHERE EXSITS