RIA Services query: Nested "from" and include children

Posted by Stéphane Bebrone on Stack Overflow See other posts from Stack Overflow or by Stéphane Bebrone
Published on 2010-04-02T07:03:50Z Indexed on 2010/04/02 7:13 UTC
Read the original article Hit count: 706

Filed under:
|

Hi guys,

I have the following schema.

What I'd like to do is to retrieve all customers (and children properties) from a selected StaffAssignment by StaffId.

So I've written the following query:

from c in ObjectContext.Customers.Include("Assignments.Activities")
               from a in c.Assignments
               from sa in a.StaffAssignments
               where sa.StaffId == staffId
               select c

But children properties aren't loaded (I added the [Include] in service metadata file as well).

What did I do wrong?

Gtz, Stéphane.

© Stack Overflow or respective owner

Related posts about netriaservices

Related posts about LINQ