O'Reilly logo

WCF Multi-layer Services Development with Entity Framework Fourth Edition by Mike Liu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the service interface layer

In the previous section, we have created a WCF project using the WCF Service Library template. In this section, we will create the service interface layer contracts.

As two sample files have already been created for us, we will try to reuse them as much as possible. Then, we will start customizing these two files to create the service contracts.

Creating service interfaces

To create the service interfaces, we need to do the following to the IService1.cs file:

  1. Change the filename from IService1.cs to IProductService.cs. This will also change the interface name from all related places inside the project.
  2. Change the first operation contract definition. Consider the following line:
    string GetData(int value);

    Change it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required