What is dependency injection (DI)? How is it implemented in C#?
Ask by ICSM Computer
Updated 20 Jun 2025
DI is a design pattern that allows objects to receive their dependencies from external sources rather than creating them.
Benefits:
Implementation Example (Manual DI):
In .NET Core, use built-in DI container via
Startup.csorProgram.cs.