markrendle/Simple.Web — pull request #6 by RoyJacobs (2012-06-11 12:58:03+00:00)
Title: Ioc scope

Related to #1. This is based on the StructureMap support but also includes nested container support.

Handlers are now not passed around as simple `object` instances but as `IScopedHandler` instances. This basically wraps the handler in an `IDisposable`. Once the handler is finished it can be disposed.

This does break the authentication though, since that relies on using the DI container as a servicelocator (see `CheckAuthentication.cs`). Ideally this class would also be able to request its dependencies in a regular fashion. Authentication might also require a per-thread database session for instance, so the `IAuthenticationProvider` it requests should probably also be scoped to the current container anyway.