Pergunta de entrevista da empresa Ideagen

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

Resposta da entrevista

Sigiloso

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; } }