title: Cast child object to parent type for serialization
body: <p>I need to be able to cast an instance of a child object to an instance of its parent object.</p>
  <pre class="lang-c# prettyprint-override"><code>public class Parent 
  {
      public string name{ get; set; } 
  }
  
  public class Child : Parent { }
  
  var myClass = new Child();
  
  (Parent)myClass;
  </code></pre>
  <p>The cast above doesn't seem to work, and the object still has child's type <strong>when serialized</strong>.</p>
  <p>Is there another way to cast it?</p>
  <p>I'm only using the child class for validation– I need the child to have <em>only</em> the parent's type for serialization reasons.</p>