title: Bind a Global Action Filter to all Controllers in an Area using MVC 3 Dependency Injection with Ninject 2.2
body: <p>I was able to to use ASP.NET MVC 3 and Ninject 2.2 to inject a logger object into a custom ActionFilterAttribute thanks to the help I received in this <a href="https://stackoverflow.com/questions/5439921/mvc-3-dependency-injection-with-ninject-2-2-global-action-filter">post</a>.</p>
  
  <p>Now I would like to bind my custom ActionFilterAttribute only to all controllers that are in a specific area.</p>
  
  <p>I was able to get started with the following binding but it only handles one controller in a certain area. I would like my code to bind to all controllers in a specific area. Any ideas?</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Load your modules or register your services here!
  /// &lt;/summary&gt;
  /// &lt;param name="kernel"&gt;The kernel.&lt;/param&gt;
  private static void RegisterServices(IKernel kernel)
  {
      kernel.Bind&lt;ILogger&gt;().To&lt;Log4NetLogger&gt;().InRequestScope();
      kernel.BindFilter&lt;TestLoggingAttribute&gt;(
          FilterScope.Controller, 0)
              .WhenControllerType&lt;OrganizationController&gt;();
  }
  </code></pre>