I'm working on a .NetCore Web API project.
The project uses Depencency Injection. Each controller leverages constructor injection to get dependencies.
As the features grow, the code level dependencies grow and become complex to manage in terms of code quality(e.g. SonarQube, where maximum parameters are limited to 7).
Why is constructor injection preferred?
What about just injecting IServiceProvider
and using GetServices<T>()
?