Environment is SL 4 with VS 2010 RC.
I'm trying to let users compose a query for "Machine" records -- so my query needs to return Machine entities. I've done a system where a list of user criteria is created and then I loop through them adding criteria like this:
query = query.Where(m => m.MachineType = _machineType);
query = query.Where(m =>m.CustomerID = _customerID);
...etc. (query is a EntityQuery as returned from RIA Services)
Now these machines can have different software products on them -- the software products are are in a different table with a relationship (SerialNumber) to the Machine table. I have defined the relationship in the entity model and have a navigation property. I can navigate the property and can even do a query to get a list of Machines by doing this:
var swLicense = ctx.Licenses.Include("vwMachine").Where(lic => lic.ProductID == _prodID);
var systems = swLicense.Select(lic => lic.vwMachine);
But now I've ended up with a different list (systems) which I either have to combine somehow with the other query criteria (query) or somehow get this subquery into the original query.
Where do I go from here?