title: How to create a base class that accepts parameters for controllers without changing child controllers?
body: <p>I'm trying to add ninject to the following setup -</p>
  
  <pre><code>public class BaseController : Controller
  {
      protected ILogger Logger {get;}
      public BaseController() { Logger = new MyLogger(); }
  }
  public class Controller1Controller : BaseController { ... }
  public class Controller2Controller : BaseController { ... }
  ....
  public class ControllerNController : BaseController { ... }
  </code></pre>
  
  <p>With ninject, adding an ILogger parameter to BaseController works great - </p>
  
  <pre><code>public class BaseController : Controller
  {
      protected ILogger Logger {get;}
      public BaseController(ILogger logger) { Logger = logger; }
  }
  </code></pre>
  
  <p>but now it also requires adding a constructor in each of the child controllers because the base class no longer has a parameterless constructor-</p>
  
  <pre><code>public class Controller1Controller : BaseController { 
      public Controller1Controller(ILogger logger) : base(logger) { }
  }
  </code></pre>
  
  <p>There are over 50 child controllers and going forward it might become a bit of a maintenance problem if we have to add/remove more dependencies. Further, the code being added to each controller is exactly the same.</p>
  
  <p>Is there a way to keep the child controllers as they are (without any constructors) but still make that change to the BaseController?</p>