2
votes

I've studied Castle Windsor documentation and existing topics in stackoverflow abut dependencies resolution using this container but i still didn't get is it possible (and if it is then how?):

1) to register several implementations of interface for instance like this:

            container.Register(Component.For<IWait<IWebDriver>>().UsingFactoryMethod(ctx => SmallWait));
            container.Register(Component.For<IWait<IWebDriver>>().UsingFactoryMethod(ctx => MediumWait));
            container.Register(Component.For<IWait<IWebDriver>>().UsingFactoryMethod(ctx => LongWait));

`

and just use resolve it via ResolveAll or receiving it automatically in constructor parameter or field of IEnumerable<T>.

2) to remove registration of component from container?

1

1 Answers

3
votes
  1. Yes, it is possible, you do need to give them unique IDs though via .Named().
  2. No, un-registering is not supported. It may be an instinctive answer to some problems but it's never the right one.