Windsor Castle: Clearing the container
Is there a way in Windsor Castle to clear (release) all the components without actually destroying the container in the process? I would like to be able to have the开发者_JS百科 container reinitialized to the state after all the installers have done their work but before any components have been resolved.
For the sake of discussion assume there are no auto-startable components in the container.
No, there's no way to do that, at least not that I can think of.
Just an idea... What about creating your own Lifestyle Manager that keeps a cache of resolved components and (admittedly, there may be a better way) a method on the Lifestyle Manager to ReleaseAll components? Not ideal, but may work.
精彩评论