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 ...

Get WCF Multi-layer Services Development with Entity Framework Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.