I want to use Dependecy injection in my new .net core project, but my manager thinks it is an anti-pattern usage. I already know benefits of dependency injection. But my manager cares architecture more than everything. Anyway, when search about it, i have read enough reviews. There are different opinions about it and i am still not sure. So asking here. Is it an antipattern example or not? If it is not what is the best practice, is it okey to reference data and businness layers on UI layer? I always use this structure but just want to do deeper research best practice about that.

有帮助吗?

解决方案

By defition the dependency injection is a pattern.

The ASP.NET Core is built around dependency injection as it allows great flexibility in the framework.

In a plain .NET Core application, the DI pattern can be used and also overused. As with any technology and patterns, in may be used inapropriately. This depends on your application and must be evaulated based on actual requirements for the app.

许可以下: CC-BY-SA归因
scroll top