How to initialize class in WCF?
Suppose I just want to make a sum of two member in a class.
I have coded in iService like:
[DataContract]
class Sample
{
public int i { get; set; }
public int q { get; set; }
}
[OperationContract]
public int Sum(Sample obj);
And in service:
public int Sum(Sample obj)
{
}
What added coding require to make that run, as I am confuse with the class declaration in both the pages?
Usually, it would be set up like below. You should clearly separate the service from the data contracts.