Chapter 32. Data Services


  • Overview of WCF Data Services

  • WCF Data Services hosting with CLR objects

  • HTTP client access to WCF Data Services

  • URL queries to WCF Data Services

  • WCF Data Services with the ADO.NET Entity Framework

  • Using the WCF Data Services .NET Client Provider

  • Tracking, Updates, and Batching

In the previous chapter you saw the ADO.NET Entity Framework used to easily create an object model to map to the database structures. The Entity Framework does not provide a way to get the objects across different tiers. This is where WCF Data Services come into play. WCF Data Services offers a WCF service to easily access data provided by an Entity Data Model or by simple CLR objects implementing the IQueryable<T> interface.


The ADO.NET Entity Framework offers mapping and creates entity classes representing databases. With the data context from the Entity Framework, the data context stays informed about changes to data so that it knows what should be updated. The Entity Framework does not help when creating solutions over multiple tiers.

Using WCF Data Services, you can use the Entity Framework (or a simple CLR object model) on the server side and send HTTP queries from the client to the service to retrieve and to update data. Figure 32-1 shows a typical scenario with a Windows client or a Web page using HTML and JavaScript to send an HTTP request to the server.

Figure 32.1. FIGURE 32-1

The returned information can be in AtomPub or JSON format. AtomPub is the ...

Get Professional C# 4 and .NET 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.