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

Here we will learn about 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.

}

Comments

Popular

C# 6.0 New Features

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX

What is Cloud Computing - A guide for beginners