I have many, many relationships as follows:
Products Product Code Description
ProductFeatures ProductFeatureID FeatureId Product Code
FeatureId Features Description
Any product can have many functions.
Then I get down to iQueryable called "SearchFeatures", which contains two separate Feature objects that I want to execute.
I want to find Products that have ALL of these features!
eg. something like this would be nice:
return db.Products.Where(x => x.Features.ContainsAll(SearchFeatures));
What is the cleanest way to achieve this with LINQ?
Many thanks.
Aaron source share