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 service interface layer


The last step is to create the service interface layer. Again, the steps here are very similar to the steps in Chapter 5, Implementing a Three-layer WCF Service, so you can refer to this chapter for more details.

  1. Right-click on the solution item and select Add | New Project.... Add a WCF Service Library project with the name NorthwindService.

  2. Add a project reference to NorthwindLogic and NorthwindBDO to this new service interface project.

  3. Right-click on the project item NorthwindService, select Manage NuGet Packages… and then install Entity Framework.

  4. Change the service interface file, IService1.cs, as follows:

    1. Change its filename from IService1.cs to IProductService.cs. This will also change the interface name and all related places in the project.

    2. Remove the original two service operations and add the following two new operations:

      [OperationContract]
      [FaultContract(typeof(ProductFault))]
      Product GetProduct(int id);
      
      [OperationContract]
      [FaultContract(typeof...