Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WCF Multi-layer Services Development with Entity Framework - Fourth Edition

You're reading from   WCF Multi-layer Services Development with Entity Framework - Fourth Edition Create and deploy complete solutions with WCF and Entity Framework

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781784391041
Length 378 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Mike Liu Mike Liu
Author Profile Icon Mike Liu
Mike Liu
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Implementing a Basic HelloWorld WCF Service 2. Hosting the HelloWorld WCF Service FREE CHAPTER 3. Deploying the HelloWorld WCF Service 4. Debugging the HelloWorld WCF Service 5. Implementing a Three-layer WCF Service 6. Adding Database Support and Exception Handling 7. LINQ to Entities – Basic Concepts and Features 8. LINQ to Entities – Advanced Concepts and Features 9. Applying LINQ to Entities to a WCF Service 10. Distributed Transaction Support of WCF 11. Building a RESTful WCF Service 12. WCF Security 13. Extending WCF Services 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime