title: Using a parameterless controller constructor with Ninject?
body: <p>I'm using Ninject for dependency injection in my application. Here's an example of one of my controllers:</p>
  
  <pre><code>public class DepartmentsController : Controller
  {
      private IDepartmentsRepository departmentsRepository;
  
      public DepartmentsController(IDepartmentsRepository departmentsRepository)
      {
          this.departmentsRepository = departmentsRepository;
      }
  
      ...
  }
  </code></pre>
  
  <p>I'm also trying to follow <a href="http://dotnetdarren.wordpress.com/2010/07/27/logging-on-mvc-part-1/" rel="nofollow">this tutorial</a> to use ELMAH in an MVC application. The idea is to use a custom controller factory to handle errors from every controller. You then set the controller factory to the custom one in the global.asax.cs file.</p>
  
  <p>The only problem is that it is expecting a parameterless constructor in each controller, which I can't do (that I know of) with dependency injection with Ninject.</p>
  
  <p>How can I get around this?</p>