Skip to main content
Home Forums Silverlight Programming WCF RIA Services If client side Linq would cause async call?
2 replies. Latest Post by ColinBlair on May 11, 2009.
(0)
kent.zhou
Member
109 points
397 Posts
05-11-2009 2:36 PM |
If following code at client side is applied to Ria service, it's supposed to get the data from memory of cache:
context.Employee.Where(e => e.DepartmentID == id);
If there is no data available for above code(for example, first time call), will it cause async call to get data from ria service?
mathewc
614 points
111 Posts
05-11-2009 4:13 PM |
No - you have to explicitly load data into the client DataContext. The above is just a client side LINQ query against the results (if any) currently in the EntityList<Employee>.
ColinBlair
Contributor
6579 points
1,291 Posts
05-11-2009 4:31 PM |
I assume you are looking at the difference between ADO.NET Data Services and RIA Services. A DataServiceContext would be exposing Employee as a DataServiceQuery<Segment>. The RIA Services DomainContext exposes Employee as an EntityList<Employee>. In effect, DataServiceContext's Employee is the equivalent of DomainContext's GetEmployees and DataServiceContext's Employee is the equivalent of going to the DomainContext's Entity collection and finding all of the Employees in it.