title: How to get only base class properties from derived class?
body: <p>My code is like this</p>
  
  <pre><code>public class BaseClass
  {
      public string Field1 { get; set; }
  }
  
  public class DerivedClass: BaseClass
  {
      public string Field2 { get; set; }
  }
  
  var obj = new DerivedClass { Field1 = "aaa", Field2 = "bbb" };
  </code></pre>
  
  <p>I have to serialize <code>obj</code> but I only need the <code>BaseClass</code> properties since <code>DerivedClass</code> properties are "additional info" which is added after deserialization.</p>
  
  <p>How can I get them? (I can't use <code>[JSonIgnore]</code> decorator because I have to send <code>DerivedClass</code> objects over websocket and I'll lose informations)</p>