Pregunta de entrevista de Ideagen

What is Dependency Injection and how is it implemented in .NET Core?

Respuesta de la entrevista

Anónimo

26 de jul de 2025

Dependency Injection (DI) is a design pattern that allows you to inject dependencies into a class rather than hardcoding them. In .NET Core, DI is built-in via the IServiceCollection and IServiceProvider. services.AddScoped(); public class ProductController : Controller { private readonly IProductService _service; public ProductController(IProductService service) { _service = service; } }