Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By : Mike Liu
Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By: Mike Liu

Overview of this book

Table of Contents (20 chapters)
WCF Multi-layer Services Development with Entity Framework Fourth Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Hosting the HelloWorld WCF Service
Index

Creating the business logic layer


Now, let's create the business logic layer. The steps here are very similar to the steps in Chapter 5, Implementing a Three-layer WCF Service, so you can refer to that chapter for more details:

  1. Right-click on the solution item and select Add | New Project.... Add a class library project with the name NorthwindLogic.

  2. Add a project reference to NorthwindDAL and NorthwindBDO to this new project.

  3. Rename the Class1.cs file to ProductLogic.cs. This will also change the class name and all related places in the project.

  4. Add the following two using statements to the ProductLogic.cs class file:

    using NorthwindDAL;
    using NorthwindBDO;
  5. Add the following class member variable to the ProductLogic class:

    ProductDAO productDAO = new ProductDAO();
  6. Add the following new method, GetProduct, to the ProductLogic class:

    public ProductBDO GetProduct(int id)
    {
        return productDAO.GetProduct(id);
    }
  7. Add the following new method, UpdateProduct, to the ProductLogic class:

    public bool UpdateProduct...