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:
Right-click on the solution item and select Add | New Project.... Add a class library project with the name
NorthwindLogic
.Add a project reference to
NorthwindDAL
andNorthwindBDO
to this new project.Rename the
Class1.cs
file toProductLogic.cs
. This will also change the class name and all related places in the project.Add the following two
using
statements to theProductLogic.cs
class file:using NorthwindDAL; using NorthwindBDO;
Add the following class member variable to the
ProductLogic
class:ProductDAO productDAO = new ProductDAO();
Add the following new method,
GetProduct
, to theProductLogic
class:public ProductBDO GetProduct(int id) { return productDAO.GetProduct(id); }
Add the following new method,
UpdateProduct
, to theProductLogic
class:public bool UpdateProduct...