4 ms·
In .NET a lot of DI is done by adding another interface to the constructor. So if you need some service way down the stack you add it to the constructor. This t
by spaetzleesser 5y ago
In .NET a lot of DI is done by adding another interface to the constructor. So if you need some service way down the stack you add it to the constructor. This then in turn can require adding this dependency to all the tests that use this service.
- infogulch 5y agoMy comment describes a way to organize unit tests to work around this issue.
- Van-Dame 5y agoComments like these really amaze me. What sort of competent editor cannot handle such simple refactorings?
- hackerfromthefu 5y agoMaybe but in Blazor you have the choice of Property or Constructor DI. This choice is in all the major DI container libraries I've worked with in .NET, around a dozen over the years.