title: How to send all objects in base object using WCF
body: <p>I am working on a project where i have to send data to server from client device using WCF. The project has a Model that is already developed. All classes in model are subclasses of SObject. </p>
  
  <p>In synchronizing project i am doing the following.</p>
  
  <pre><code>    [ServiceContract]    
  public interface IMobileService
  {
  
      [OperationContract]
      SynchronizeResponse Synchronize(SynchronizeRequest request);
  
      [OperationContract]
      SynchronizeResponse Checkout(CheckoutRequest request);
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    [DataContract]
  public class SynchronizeResponse
  {
      [DataMember]
      public bool FullSync { get; set; }
  
      [DataMember]
      public IEnumerable&lt;Student&gt; Students { get; set; }
  
      [DataMember]
      public IEnumerable&lt;Teacher&gt; Teachers { get; set; }
  
      [DataMember]
      public IEnumerable&lt;SObject&gt; SObject { get; set; }}
  </code></pre>
  
  <p>and same type of code for Class SynchronizeRequest</p>
  
  <p>It works in that way. but how can i send just SObject that include all sub objects? i have tried [KnownType(typeof(Student))] in the SyncRequest attribute. but it throws exception.</p>
  
  <p>without editing model, what is best way to accomplish the task.</p>