I am prototyping a generic data browser over WCF Data Services.
The user can select the entities from a TreeView, thus I cannot hardcode the query result types and have to code the queries (URI or LINQ) dynamically.
To offer joins across different Data Services I am loading the results from each Data Service to the client an try to dynamically join them:
Dim q1 As IQueryable = ctx.Execute(Of Object)(New Uri("Service1.svc/Customers")).ToList.AsQueryable
Dim q2 As IQueryable = ctx.Execute(Of Object)(New Uri("Service2.svc/Orders")).ToList.AsQueryable
Dim j = q1.JoinDynamic("q1", q2, "q2", "q1.CustomerID", "q2.CustomerID", "New (q1.CustomerID as q1id, q1.CompanyName as CompanyName)")
I'm am stuck with a problem using the dynamich Join. See: link text
Is ctx.Execute the right way to query results when the types not known until runtime?
Does someone have a better idea on how to implement dynamic joins over Data Services?