3
Vote

Support for Dependency Injected Collections

description

<p>There should be support for injecting collections into constructors through Unity.</p>

comments

ctavares wrote Mar 1, 2011 at 12:03 AM

There is support for injecting arrays. We aren't planning to implement anything further (other than possibly IEnumerable) at this time, as the set of collections that could be injected is pretty much infinite.

stesieber wrote Oct 14, 2015 at 6:54 AM

Still forcing the clients to design their classes with arrays instead of more decent collections is an invitation for bugs.
We're usually never using arrays without a good reason, thus it requires a comment in the constructor that it's there for unity. Otherwise the next developer will get rid of it.

Is there maybe a way to change the behavior of unity in our solutions to support more than just arrays there?

dot_NET_Junkie wrote Oct 14, 2015 at 9:20 AM

This project isn't maintained by Microsoft anymore (http://blogs.msdn.com/b/dotnet/archive/2015/08/21/the-future-of-unity.aspx). You can post any requests and issues here: https://github.com/unitycontainer/unity/issues.

dot_NET_Junkie wrote Oct 14, 2015 at 9:20 AM

This project isn't maintained by Microsoft anymore (http://blogs.msdn.com/b/dotnet/archive/2015/08/21/the-future-of-unity.aspx). You can post any requests and issues here: https://github.com/unitycontainer/unity/issues.

stesieber wrote Oct 14, 2015 at 11:55 AM

oh, damn, I somehow missed the announcement. I'll add my comment on the github page.