title: Why web API Action method returning Json of child properties even after casting it's parent class
body: <p>I have web api controller like this:</p>
  
  <pre><code>public class ParentController : ApiController
  {
      [HttpGet]
      public IHttpActionResult GetParent()
      {
          //instatiating child class
          var child = new Child
          {
              ChildProp1 = "childValue1",
              ChildProp2 = "childValue2",
              ParentProp1 = "parentValue1",
              ParentProp2 = "parentValue2"
          };
  
          //up casting is implicit
          Parent parent = child;
  
          //returning parent as Json http request
          return Ok(parent);
      }
  
      private class Child : Parent
      {
          public string ChildProp1 { get; set; }
          public string ChildProp2 { get; set; }
      }
  
      private class Parent
      {
          public string ParentProp1 { get; set; }
          public string ParentProp2 { get; set; }
      }
  }
  </code></pre>
  
  <p>and it works perfectly except it return Json result of both parent and child properties and What I need is <strong>only properties of parent class</strong></p>
  
  <p>Output response body:</p>
  
  <pre><code>{
      "childProp1": "childValue1",
      "childProp2": "childValue2",
      "parentProp1": "parentValue1",
      "parentProp2": "parentValue2"
  }   
  </code></pre>
  
  <p>Thanks!</p>