title: Cast parent class to child class
body: <p>I have Message class which I have extended and added new property.</p>
  
  <pre><code>class ChildMessage: Message 
  {
  prop...
  }
  </code></pre>
  
  <p>While trying to add Message Class to ChildMessage list I get Null reference for added class.</p>
  
  <pre><code>var myChildList =new List&lt;ChildMessage&gt; ();
  var myParentClass = new Message();
  myChildList.add(myParentClass as ChildMessage)
  
  myChildList[0] == null //Always return null 
  </code></pre>
  
  <p>What is wrong with my code? What are the alternatives?</p>