title: Pass current object type into base constructor call
body: <p>How do I grab the <code>Type</code> of the inherited class and pass it into the base constructor of the class also inherited? See the code sample below:</p>
  
  <pre><code>// VeryBaseClass is in an external assembly
  public abstract class VeryBaseClass
  {
      public VeryBaseClass(string className, MyObject myObject)
      {
  
      }
  }
  
  // BaseClass and InheritedClass are in my assembly
  public abstract class BaseClass : VeryBaseClass
  {
      public BaseClass(MyObject myObject) :
          base(this.GetType().Name, myObject) // can't reference "this" (Type expected)
      {
  
      }
  }
  
  public class InheritedClass : BaseClass
  {
      public InheritedClass(MyObject myObject)
      {
  
      }
  }
  </code></pre>
  
  <p>The line <code>base(typeof(this).Name, myObject)</code> doesn't work because I can't reference <code>this</code> yet, as the object hasn't finished constructing and therefore doesn't exist.</p>
  
  <p>Is it possible to grab the <code>Type</code> of the currently constructing object?</p>
  
  <p>EDIT:</p>
  
  <p>Corrected the sample as <a href="https://stackoverflow.com/questions/2287636/pass-current-object-type-into-base-constructor-call/2287670#2287670">orsogufo suggested</a>, but still doesn't work, as <code>this</code> is undefined.</p>
  
  <p>EDIT 2:</p>
  
  <p>Just to clarify, I want to end up with <code>"InheritedClass"</code> being passed into the <code>VeryBaseClass(string className, MyObject myObject)</code> constructor.</p>