Explain dependency injection (DI).

A: DI supplies a class’s dependencies from the outside, improving testability and decoupling.
Example: In ASP.NET Core, you register IMyService in Startup.ConfigureServices and the framework injects it into controllers.

Leave a Reply

Your email address will not be published. Required fields are marked *