Closed AlexanderDorofeev closed 7 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:
appSettings
key. (If the key isn't there, use the current behavior; if the key is there, use that HttpModule
name from the HttpApplication.Modules
collection.)HttpApplication
like GetContainerProviderAccessor
to run that "if config/else application" logic.That would be pretty minimally impacting and should get you what you're looking for. Am I missing something?
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.
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
`