I would like to resolve the following with castle windsor:
IEnumerable<Definition<IEntity>>
At the moment I'm only getting an IEnumerable with 1 object which matches the first implementation of IEntity.
I would like an array of
{ Definition<Entity1>, Definition<Entity2>, ... }
I have a feeling a sub resolver is needed but I have no idea where to start.
Update
var container = new WindsorContainer();
container.Kernel.Resolver.AddSubResolver(
new CollectionResolver(container.Kernel, true));
container.Register(Component.For(typeof (Definition<>)));
var binDir = HostingEnvironment.MapPath("~/bin");
var assemblyFilter = new AssemblyFilter(binDir);
container.Register(Types.FromAssemblyInDirectory(assemblyFilter)
.BasedOn<IEntity>()
.Unless(t => t.IsAbstract || t.IsInterface)
.WithServiceAllInterfaces()
.LifestyleTransient());
// This doesn't work!
var items = container.Resolve(typeof(IEnumerable<Definition<IEntity>>));