title: inheritance in c#. copy properties in the base object
body: <p>I have an object (A) with many properties. I make a new object B that extends the object A with some new properties.</p>
  
  <p>Then I have an method AA that returns the instance of object A, but in my current method BB I use the new instance of object B.</p>
  
  <p>Do I have any way to use the return of the method AA to assign in the object B?, How do I assign to B avoiding copy property by property?</p>
  
  <pre><code>class A
  {
     string a1 {get; set;}
     // ...
     string a50 {get; set;}
  }
  
  class B: A
  {
     string bState {get; set;}
     string bMessage {get; set;}
  }
  
  class ObjAA
  {
     public static AA ReturnAA() 
     {
         AA oAA = new AA();
         //... 
         return oAA;
     }
  }
  
  class ObjBB
  {
     public void UseBB() 
     {
         BB oBB = new BB();
  
         var aa = ObjAA.ReturnAA();
  
         // How do I assign to B avoiding property by property?
     }
  }
  </code></pre>
  
  <p>thanks</p>