Chapter 14. Using Entities with Web and WCF Services

Services are a critical part of today’s (and tomorrow’s) application environments. You can use entities in service applications, and depending on your needs you can approach the task of using the Entity Framework with services in a number of ways. You can build your own services in the form of ASMX (“classic”) and Windows Communication Foundation (WCF) services, which were introduced in .NET 3.0.

In this chapter, you will write an ASMX Web Service and a WCF service leveraging what you’ve already learned about the Entity Framework. In Chapter 22, we will revisit WCF services, and there you will use some of the more in-depth knowledge you will gain in the latter part of this book to write a more streamlined WCF service that will impact how the service is consumed.

The services in this chapter will be consumed by a simple Windows Forms client application.

Note

If you have never built either a web service or a WCF service before, have no fear. The walkthroughs will provide you with step-by-step details.

Building a Client That Is Ignorant of the Entity Framework

In this chapter, the samples depend on the Entity Framework only on the server side. The clients that consume the services use a simplified version of the classes that the services provide. The client will not perform any database connections, change tracking, relationship management, or anything else that depends on Object Services. This means that not only does your client not ...

Get Programming Entity Framework 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.