I'm trying to get all items that have a data equal to (1 OR 2) AND a data equal to (6 OR 7)
var oneFromEachList = new[] {
new[] {1,2}, // 1 OR 2
new[] {6,7}, // AND 6 OR 7
};
// item.dataList is an IEnumerable<int>
DbSet<Table>.Where(item => oneFromEachList.All(list => item.dataList.Any(list.Contains)))
This query is what I want to do, but it can't be converted to SQL, I get: "The nested query is not supported. Operation1='Case' Operation2='Collect'"
Note that the oneFromEachList object is known before the query is executed (it's not from the database). I guess it's possible to build an Expression by composing .Where statements? This seems very complicated for what it is though...