What is Operation Contract in WCF Service?

In my earlier blog I wrote about Contracts and Service Contract. Please refer this link Service Contract in WCF

Operation Contract

Operation Contracts are nothing but the functions or methods exposed to the client which may or may not return to perform some logic at server end.

A simple Operation Contract with Service Contract will look like this.

[ServiceContract]
public interface ICalculate
{
    [OperationContract]
    int Sum(int num1, int num2); 
//A function to add 2 numbers which will return an integer.

 

Leave a Comment

RSS
YouTube
YouTube
Instagram