I have a list of int
and I need to select all record from my query where the id is contained in the second list as showed below:
//my list of ids
var ids=[myquery].select(x=> x.id)
query = query.Where(x => ids.Contains(x.Id));
Now LINQ will convert the above in :
SELECT *
FROM [MyTable]
WHERE ([x].[id] IN (108,687, 689, 691, 694, 705, 703,.....)
Now the ids list will grow a lot and I guess this will ruin the performances.
What would be a better solution considering the the ids
list will contain more than 200K item ?