Assign Properties from Method
<p>I have two class, base and inherited class like these</p>

<pre><code>public class A
{
     public string Prop1 { get; set; }
} 

public class B : A
{
     public string Prop2 { get; set; }
} 
</code></pre>

<p>Now i have a method which return class <code>A</code> after populating properties values</p>

<pre><code>public A GetPopulatedValues()
{
     //code to populate values here
}
</code></pre>

<p>Now my question is, how to assign all the property values at once?</p>

<p>This works</p>

<pre><code>public void Init()
{
   var obj = new B();
   obj.Prop1 = GetPopulatedValues().Prop1;
}
</code></pre>

<p>But i want something like this</p>

<pre><code>  public void Init()
{
   var obj = new B();
   obj = GetPopulatedValues();
}
</code></pre>

<p>Any ideas?</p>
