Dependency Injection (DI)
DI is a design pattern that allows us to develop loosely coupled code. Instead of creating an object inside a class, we "inject" it.
Lifetime cycles in .NET:
- Transient: Created every time they are requested.
- Scoped: Created once per client request (e.g., web request).
- Singleton: Created once and shared everywhere.