How would I improve this 7 line Linq Query that acts as a Specification?
BigQuery at the top gets a set of Products and nested related tables. Then, I apply filtering in a poor attempt at a specification pattern. This is the filter code. There are three tables in the query, and I want to filter the top query by the value nested in the bottom query. Like I said, this currently produces the results we want. However, the .Contains() produces a SQL WHERE EXISTS() clause for each. We really only need one, but I don't know how to get the inner ID to compare with the outer ID. from p in bigQuery // Root table where ( from pp in p.LPP // Level 1 nested table where (from pv