ipjohnson / Grace

Grace is a feature rich dependency injection container library
MIT License
337 stars 33 forks source link

Extend support for special types #91

Closed darkcamper closed 7 years ago

darkcamper commented 7 years ago

I've noticed that you can automatically Locate an IEnumerable<Func> but not an Func<IEnumerable> (or at least I've been unable to make it work).

I think it would make sense when you want to declare a dependency on a single factory that returns all known exports for T.

public MyClass(Func<IEnumerable<IWhatEver>> knownWhateverFactory)
ipjohnson commented 7 years ago

So looking at this it's definitely a bug. It has to do with the way wrappers are calculated and the fact IEnumerable<T> and T[] don't have activation strategies.