What is Dependency Injection (DI)?
Ask by Anubhav Sharma
Updated 18 Mar 2026
Dependency Injection is a design pattern used to achieve loose coupling between classes.
ASP.NET Core has built-in DI container.
Example:
Service lifetimes: