If you can use an array instead of an IEnumerable, then you only need to add the ArrayResolver: http://stackoverflow.com/questions/1057977
On Oct 12, 6:21 am, Thejuan <[email protected]> wrote: > I tried posting this before, didn't seem to work. Sorry if you got it > twice. > It's in response > tohttp://groups.google.com/group/castle-project-users/browse_thread/thr... > > I have the same problem. Here is a test to show the problem. > Is there away to acheive the same thing a different way? > > [Test] > public void Bug() > { > WindsorContainer container = new WindsorContainer(); > container.AddFacility<FactorySupportFacility>(); > container.Register(Component.For<IService> > ().ImplementedBy<Service1>().Named("1")); > container.Register(Component.For<IService> > ().ImplementedBy<Service2>().Named("2")); > container.Register(Component.For<IEnumerable<IService>> > ().UsingFactoryMethod(() => container.ResolveAll<IService>())); > container.Register(Component.For<Consumer>()); > > Assert.IsNotNull(container.Kernel.Resolve<Consumer>()); > } > > public class Consumer > { > public Consumer(IEnumerable<IService> services) { } > } > > public class Service1 : IService > { > > } > > public class Service2 : IService > { > > } > > public interface IService { } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
