autofac / Autofac.Web

ASP.NET WebForms integration for Autofac
MIT License
10 stars 9 forks source link

Added option to specify http modules that implement IContainerProviderAccessor #5

Closed AlexanderDorofeev closed 7 years ago

AlexanderDorofeev commented 8 years ago

Added configuration section to specify HttpModule's that implement IContainerProviderAccessor. Modules can be limited to inject dependencies into handlers with particular namespace. Look at issue #4

`

.... ` ` `
tillig commented 8 years ago

The notion of IContainerProviderAccessor is to access the single application container rather than one or more containers. Autofac web integration doesn't support multiple application containers per application. Given that, we probably don't need the whole configuration section thing - it could be a single appSettings setting.

I've seen that modules can get instantiated multiple times in some cases so I'm curious if, by not tying right to the HttpApplication, one might run into weird things where folks using correct initialization of static fields in an HttpModule might find themselves in a weird situation where the ContainerDisposalModule tries to double-dispose the container (or something like that). Tying to the HttpApplication makes things really simple.

Let's assume not. 😄 In that case, you would basically need to:

That would be pretty minimally impacting and should get you what you're looking for. Am I missing something?

tillig commented 7 years ago

Based on the comments for #4 we're going to pass on this one, but if you need something opened up so it can be extended such that you can create your own NuGet module to support what you need, let us know and we can do that.