Questa è la tua azienda?
Write a code to implement dependency injection in C#.
Anonimo
You can just write a constructor in ASP.MVC controller like this: private IEmployeesRepository _employeesRepository; public EmployeesController(IEmployeesRepository employeesRepository) { _employeesRepository = employeesRepository; } When using any IoC container to map IEmployeesRepository to EmployeesRepository, this constructor will get an EmployeesRepository object during initialization, which will be done through constructor injection. We can then use _employeesRepository in the controller actions.