How to cast object to another where base is 'higher'?
<p>There are two classes. Class B dervied from A.</p>

<pre><code>class A
{  }

class B  : A
{  
    public B()
    {  

    }
    public int Number { get; private set; }
}
</code></pre>

<p>This gives me the error 'unable to cast from A to B'.</p>

<pre><code>void Test()
{
    var a = new A();
    var b = (B)a;     // &lt;== unable to cast.
}
</code></pre>

<p>How can I cast the object in variable A to class B? </p>

<p>Thank you.</p>
