Chapter 9. Applying LINQ to Entities to a WCF Service
Now that we have learned all of the features related to LINQ and LINQ to Entities we will use them in the data access layer of a WCF service. We will create a new WCF service very similar to the one we created in the previous chapters but in this service we will use LINQ to Entities to connect to the Northwind
database to retrieve and update a product.
In the data access layer we will use LINQ to Entities to retrieve product information from the database and return it to the business logic layer. You will see that with LINQ to Entities we will need only one LINQ statement to retrieve the product details from the database in the GetProduct
method and we will no longer need to worry about the database connection or the actual query statement.
In this chapter, we will also learn how to update a product with LINQ to Entities in the data access layer. We will see how to attach an entity object to LINQ to Entities ObjectContext
and leave all...