Customizing the business logic

For the business logic project, we need to add a class file, ProductLogic.cs, and customize it as follows:

  1. Add two using statements for the BusinessEntities, and DataAccess namespaces.
  2. Change it to be a public class.
  3. Add a new method, GetProduct, to call the data access layer to retrieve a product from database.

The final ProductLogic class file should look like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyWCF.EasyNorthwind.BusinessEntities;
using MyWCF.EasyNorthwind.DataAccess;
namespace MyWCF.EasyNorthwind.BusinessLogic
{
public class ProductLogic
{
ProductDAL productDAL = new ProductDAL();
public ProductEntity GetProduct(int id)
{
return productDAL.GetProduct(id);
}
}
}

Build the business logic project, to make sure that there is no build error.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset