views:

34

answers:

1

Lets say I have some code like:

ExampleDomainContext ctx = new ExampleDomainContext();

var query = from p in ctx.GetPeopleQuery()
            where p.Id > 2
            select p;

ctx.Load<Person>(query).Completed += (s, e) =>
{
    // do some stuff
};

This is being done on the client, and the GetPeopleQuery() call from the RIA service returns all people from the people table.

My question is whether the query (people whose Id > 2) is getting translated to the server and run or does the server return all people to the client and then do the filtering?

+5  A: 

Any filters specified as part of the EntityQuery given to the Load() method will be performed on the server. You can further query the results of queries on the client if needed.

Jeff Handley
Thanks for clarifying
AdamD