title: Why is my ASP.NET Web API ActionFilterAttribute OnActionExecuting not firing?
body: <p>I'm trying to implement what's seen here: <a href="http://www.piotrwalat.net/nhibernate-session-management-in-asp-net-web-api/" rel="noreferrer">http://www.piotrwalat.net/nhibernate-session-management-in-asp-net-web-api/</a> but I'm having an issue with my <code>NhSessionManagementAttribute</code>.</p>
  
  <p>I've set breakpoints on my <code>OnActionExecuting(HttpActionContext actionContext)</code> to see whether the function was ever being called -- it wasn't.</p>
  
  <p>I double-checked my <code>global.asax.cs</code> file &amp; found I am in fact registering the <code>ActionFilter</code> with: </p>
  
  <pre><code>GlobalConfiguration.Configuration.Filters.Add(new NhSessionManagementAttribute());
  </code></pre>
  
  <p>I have also decorated both my controller class itself, as well as its actions with the attribute to no avail:</p>
  
  <pre><code>public class ClientsController : ApiController {
      static readonly ClientRepository repository = new ClientRepository();
  
      [NhSessionManagement]
      public IEnumerable&lt;Client&gt; GetAllClients() {
          return repository.GetAll();
      }
  
      [NhSessionManagement]
      public Client GetClient(int id) {
          Client client = repository.Get(id);
          if (client == null) {
              throw new HttpResponseException(
                  new HttpResponseMessage(HttpStatusCode.NotFound)
              );
          }
          return client;
      }
  }
  </code></pre>
  
  <p>Why would this action filter not be firing any of the events within?</p>