Implementing contracts in services
Once we have decided upon an interface definition for a service, we are able to move forward with the service which implements this interface. For those of you who have previously built .NET interface classes and then realized those interfaces in subsequent concrete classes, the WCF model is quite natural. In fact, it's the same. We build a concrete service class and choose to implement the WCF service contract defined earlier. For this example, we will take the previously built interface (which has since had its Insert operations replaced by a single operation that takes a data contract parameter) and implement the service logic.
Note
Consider creating distinct Visual Studio projects to house the service contract and the service implementation. This allows you to share the contract project with service consumers without sharing details of the service that realizes the contract. This idea is shown in the following screenshot:
An example code for the...