title: Objects created by AsPerRequestSingleton() are not disposed automatically
body: <p>I'm trying to use dependency injection with TinyIOC in NancyFX.</p>
  
  <p>What I intend to do, is have one SqlConnection per request which should be closed automatically. What I have done so far, is create a CustomBootstrapper, which overrides the ConfigureRequestContainer method and registers my IDbConnectionService with the AsPerRequestSingleton() method.</p>
  
  <p>This should make sure that the SqlConnectionService exists per request and should be destroyed after the request. At least, that is what I think it should do after reading the documentation.</p>
  
  <p>The custom bootstrapper:</p>
  
  <p><a href="https://github.com/mschlechter/NancyFxTutorial/blob/master/NancyFxTutorial.Web/CustomBootstrapper.cs" rel="nofollow noreferrer">https://github.com/mschlechter/NancyFxTutorial/blob/master/NancyFxTutorial.Web/CustomBootstrapper.cs</a></p>
  
  <p>And the SqlConnectionService:</p>
  
  <p><a href="https://github.com/mschlechter/NancyFxTutorial/blob/master/NancyFxTutorial.Web/Services/SqlConnectionService.cs" rel="nofollow noreferrer">https://github.com/mschlechter/NancyFxTutorial/blob/master/NancyFxTutorial.Web/Services/SqlConnectionService.cs</a></p>
  
  <p>This service implements the IDisposable interface and should dispose the underlying SqlConnection (IDbConnectionService inherits from IDisposable).</p>
  
  <p>Unfortunately, this Dispose() method is never called. So as things stand right now, it will keep connections to the database open. Which is a (really) bad thing :-)</p>
  
  <p>My question is how to fix this using dependency injection.</p>
  
  <p>I'm trying to emulate a pattern I know from Spring MVC on Java. Every service can call getCurrentSession() to get a Hibernate session. A request scoped SessionFactory is injected and every service can do sessionFactory.getCurrentSession() to get the current session.</p>
  
  <p>I would love to do the same kind of thing using NancyFX and TinyIOC.</p>
  
  <p>Getting back to my original question: why is the Dispose method not called on an object created with AsPerRequestSingleton() and what can I do to get the intended result? (an object which lives during the duration of the request / response scope, and will be automatically disposed when done)</p>
  
  <p>Thanks in advance and with best regards,
  Marc Schlechter</p>