title: Datacontract in wcf
body: <p>How to initialize class in WCF?</p>
  
  <p>Suppose I just want to make a sum of two member in a class.</p>
  
  <p>I have coded in iService like:</p>
  
  <pre><code>[DataContract]
  class Sample
  {
      public int i { get; set; }
      public int q { get; set; }
  }
  
  [OperationContract]
  public int Sum(Sample obj);
  </code></pre>
  
  <p>And in service:</p>
  
  <pre><code>public int Sum(Sample obj)
  {
  }
  </code></pre>
  
  <p>What added coding require to make that run, as I am confuse with the class declaration in both the pages?</p>