Querying Data

One of the most common requirements of any data framework is the ability to perform queries. WCF Data Services allow two modes on the client side. The first one is utilizing query strings similarly to what it is possible to do with Uris. To accomplish this you invoke the Execute(Of T) method from the DataServiceContext class, where T is the type you want to retrieve a collection of. For example, the following code returns a collection of orders for the specified customer, sorted by order date:

image

This way is efficient but avoids the strongly typed approach provided by LINQ. Fortunately the .NET Framework also enables using a special ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.