Reputation: 167
I have a One to Many relationship. I want to select all records from the parent table where it's children all meet a specific condition. If one of the children fails then that record is not returned.
Upvotes: 2
Views: 3294
Reputation: 906
Something like:
var results = parentCollection.Where(p => p.Children.All(c => <condition>));
Should do the trick.
Upvotes: 5