My goal is to constructor inject an array of objects implementing an interface.
The following is the way I currently have it.
Container
.Reg
Using Resolve
during "configuration time" is acceptable and often useful, and it's perfectly valid for arrays or enumerables.
You could also have done the above by registering the ILoader[]
type and registering each of the specific ILoader
types using the RegisterType
overload that takes a name.
Then, wherever ILoader[]
is required (e.g. needs to be injected), all of the above will resolve for you after configuration time. Of course, if you need multiple/different ILoader[]
it would devolve back to needing to use Resolve
during configuration time.