title: Owin Nancy Fx. Hookup to request events. BeforeRequest, AfterRequest, OnError
body: <p>I need to configure Nhibernate for a web app using Nancy and Owin and want to inject and open a session instance on request, close it after the request and rollback on error.</p>
  
  <p>using just Nancy I would have done something like this:</p>
  
  <pre><code>this.ApplicationPipelines.BeforeRequest += BeforeRequest;
  this.ApplicationPipelines.AfterRequest += AfterRequest;
  this.ApplicationPipelines.OnError += OnError;
  </code></pre>