C# get access to caller in parent constructor
<p>I have a child and a parent class, as such:</p>

<pre><code>class B : A{
    public B : base(){
    // stuff
    }
}



class A{
    public A(){

    // how can I gain access here to the class that called me, 
    // ie the instance of class B that's being instantiated.

     }  
}
</code></pre>

<p>As above, my question is whether I can see who called the parent constructor within the constructor of the parent class.</p>

<p>One way to do this would be to have a separate function in <code>A</code> to which you pass <code>this</code> from within B. Is there anything simpler, ie can I do this during object initialization, or is that too early in the object construction process ? Does the whole object <code>B</code> need to be "ready" before I can access it from within <code>A</code> ?</p>

<p>Thanks!</p>
