title: C# How to execute code after object construction (postconstruction)
body: <p>As you can see in the code below, the <code>DoStuff()</code> method is getting called before the <code>Init()</code> one during the construction of a Child object.</p>
  <p>I'm in a situation where I have numerous child classes. Therefore, repeating a call to the <code>DoStuff()</code> method directly after <code>Init()</code> in the constructor of each child wouldn't be an elegant solution.</p>
  <p>Is there any way I could create some kind of post constructor in the parent class that would be executed after the child's constructor? This way, I could call to the <code>DoStuff()</code> method there.</p>
  <p>If you have any other design idea which could solve my problem, I'd like to hear it too!</p>
  <pre><code>abstract class Parent
  {
      public Parent()
      {
          DoStuff();
      }
  
      protected abstract void DoStuff();
  }
  
  class Child : Parent
  {
      public Child()
      // DoStuff is called here before Init
      // because of the preconstruction
      {
          Init();
      }
  
      private void Init()
      {
          // needs to be called before doing stuff
      }
  
      protected override void DoStuff() 
      {
          // stuff
      }
  }
  </code></pre>