title: Where to put filter, attribute and extension in ASP.NET MVC
body: <p>I just got done reading Rick Anderson's article on Securing your <a href="http://blogs.msdn.com/b/rickandy/archive/2011/05/02/securing-your-asp-net-mvc-3-application.aspx" rel="nofollow">ASP.NET MVC application</a>. In the article he talked about creating new filter attributes.</p>
  
  <pre><code>public class LogonAuthorize : AuthorizeAttribute 
  {
       public override void OnAuthorization(AuthorizationContext filterContext) 
       {
           if (!(filterContext.Controller is AccountController))
               base.OnAuthorization(filterContext);
       }
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>using System;
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
  public sealed class AllowAnonymousAttribute : Attribute { }
  </code></pre>
  
  <p>My question is,  what is the best way to organize these filters and attributes?  Do I create a new class file for each? Do I create one class file for all filter and attribute?  Where is the best place to put it?  In the root folder?  in subfolder?</p>