4 ms·
Well from the sound of it he's instantiating objects manually 5 levels deep and he has control over all those constructors since he passed a new parameter throu
by reader_mode 6y ago
Well from the sound of it he's instantiating objects manually 5 levels deep and he has control over all those constructors since he passed a new parameter through all of them.
So it sounds like basically he's not using DI (is just using it to pass stuff to controllers) and is surprised that using a library designed around DI is awkward. The correct solution is use DI to construct that hierarchy and then you can just request IOptions at the bottom/where you need it.