Ioc scope #6

Merged
merged 3 commits into from Jun 11, 2012

Conversation

Projects
None yet
2 participants
Contributor

RoyJacobs commented Jun 11, 2012

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.

markrendle added a commit that referenced this pull request Jun 11, 2012

@markrendle markrendle merged commit d553202 into markrendle:master Jun 11, 2012

Owner

markrendle commented Jun 11, 2012

Yeah, using the DI to configure the AuthenticationProvider was broken anyway; there's a settable configuration property (SimpleWeb.Configuration.AuthenticationProvider) for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment