-
Book Overview & Buying
-
Table Of Contents
WCF 4.0 Multi-tier Services Development with LINQ to Entities
By :
We have two layers in our solution. We need to add one more layer—the data access layer. We need to query a real database to get the product information and update the database for a given product.
First we will create the project for the data access layer. As we did for the business logic layer, what we need to do is add a C# class library project named RealNorthwindDAL, where
DAL stands for Data Access Layer, to the solution. Then rename the Class1.cs to ProductDAO.cs and modify it as follows:
Change its namespace from RealNorthwindDAL to MyWCFServices. RealNorthwindDAL.
Change the class name from Class1 to ProductDAO.
Add a reference to the project, RealNorthwindEntities.
Now let's modify ProductDAO.cs for our product service:
Add the following using statement:
using MyWCFServices.RealNorthwindEntities;
Add two new methods to the ProductDAO class. The first method is GetProduct, which should be as follows:
public ProductEntity...
Change the font size
Change margin width
Change background colour