I need to filter out parent by property value of child collection. I am doing something like this:
var results = (from c in db.Customers where
c.Orders.Any(o => o.Status = (int)Status.Ordered)
select c;
It's fine but now I need to filter by 2 values, i.e. take all parent records that have any chilren records that have BOTH values:
var results = (from c in db.Customers where
c.Orders.Any(o => o.Status == (int)Status.Ordered) && (o.Status == (int).Shipped))
select c;
Trying something obvious like this doesn't work.