I am creating a basic Add 2 numbers
service in WCF. I have added the following inside IService.cs
[ServiceContract]
public interface ICalc{
[OperationContract]
int Add(int a, int b);
}
Now, inside the Service.cs
I have added
public class Service: IService, ICalc {
public int Add(int a, int b){
return a+b;
}
}
Now I build this service and add a service reference to it
inside a console application
Program.cs
It is called as
ICalService.Service c = new ICalService.Service();
int result = c.Add(10,20); //Now on this line I cannot seem to get the Add(int a, int b) method
which I had declared earlier.
ICalService
is the name I gave to my service when it was referenced.
Why does the Add(int a, int b)
method not show up?