views:

555

answers:

0

Hi

I am currently trying to do a nested query, using RIA Services. The first query works but the second doesn't work. I assume it is because the second query doesn't have the 'ClassAssignment' data object or something?

My questions: Why would this not be working?

In future I would like know, how is RIA working under the covers, how do I debug into this?

var classAssignmentsQ = from ca in ContactContext.ClassAssignmentsQuery
                           where ca.Class.ClassId == _classId 
                                    && ca.AssignedDate.Value.Month == _classDate.Month
                                    && ca.AssignedDate.Value.Year == _classDate.Year
                            select ca;
ContextContainer.Ctx.LoadClassAssignment(classAssignmentsQ, null);

var contacts = from con in ContactContext.ContactsQuery
               from ca in classAssignmentsQ
               where con.ContactId == ca.Contact.ContactId
               select con;
ContextContainer.Ctx.LoadContact(contacts, null);

btw, this code is in the client, which i know is not where it should be but I am just playing.