views:

64

answers:

1

Hi,

Anyone know if there exists any IoC container that can handle this:

Given:

ISomeInterfce<T> where T : Entity

Impl1 : ISomeInterfce<Entity1>

Impl2 : ISomeInterfce<Entity1>

Impl3 : ISomeInterfce<Entity2>

Impl4 : ISomeInterfce<Entity2>

I want to be able to auto wire my system and be able to resolve like this

IoC.ResolveAll(typeof(ISomeInterfce<Entity1>)) 

and get a collection back of all implementations of ISomeInterfce<Entity1>

+1  A: 

Autofac (my favourite IoC container) supports this feature, check out: http://code.google.com/p/autofac/wiki/Collections for details.

Kane
Thanks looks promising. But can you combine Autofac.Collections with Autofac.Autowiring ?
Marcus
To be honest I'm not 100% sure but I would presume it would work that way?
Kane