title: Convert derived class object to base class
body: <p>How can I convert an instance of derived class object to base class object?</p>
  
  <pre><code>class BaseClass
  {
      public int MyProperty1 { get; set; }
  }
  
  class DerrivedClass : BaseClass
  {
      public int MyProperty2 { get; set; } 
  }
  </code></pre>
  
  <p>If I have objDerivedClass with 2 properties (MyProperty1, MyProperty2) how can I convert it to objBaseClass, to have an instance of base class object? </p>