by starik36 · 6y ago · 0 comments
On my last project, I just assigned the configs to a static class that's available everywhere and the code was just simply much cleaner.
You really don't - just inject your populated config object where you need it.
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.
This is precisely why I jumped ship 5 years ago to Go.