O'Reilly logo

Professional C# 4 and .NET 4 by Morgan Skinner, Karli Watson, Jay Glynn, Bill Evjen, Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 32. Data Services

WHAT'S IN THIS CHAPTER?

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

OVERVIEW

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required