I asked very similar question here
Entity framework – select by multiple conditions in same column – referenced table
Now relationship is Many to Many.
So I have 3 tables: order, items and orderItem (items is a Junction table)
Again.. I want to select all orders that have at least one orderItem with price 100 and at least one orderItem with price 200
I really don’t know how to edit this for that scenario.
var orders = from o in kontextdbs.orders
select o;
foreach(int value in values)
{
int tmpValue = value;
orders = orders.Where(x => kontextdbs.order_item.Where(oi => x.id == oi.order_id)
}
Here is the modified version