Skip to main content

Microsoft Silverlight

Answered Question If client side Linq would cause async call?RSS Feed

(0)

kent.zhou
kent.zhou

Member

Member

109 points

397 Posts

If client side Linq would cause async call?

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
mathewc

Member

Member

614 points

111 Posts

Answered Question

Re: If client side Linq would cause async call?

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>.

-Mathew [MSFT]

ColinBlair
ColinBlair

Contributor

Contributor

6579 points

1,291 Posts

Re: If client side Linq would cause async call?

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.

-Colin Blair

http://www.RiaServicesBlog.net : The Elephant Guide to RIA Services
SLColinBlair on Twitter
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities