I want to query items with specific IDs using. For example:
var ids = new List<int> { 1, 3, 5 };
var items = context.Items.Where(item => ids.Contains(item.ID)).ToList();
Questions:
IN
operator?I am using Entity Framework 6 with Microsoft SQL Server.
If the list is really big and the table is reasonably small you might get better performance bringing the complete table into memory and do an in memory join with the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With