As in the first recipe, we will do the following:
- Inject the ServiceProducts class by using a constructor in the HomeController of an ASP.NET MVC 6 application.
- Create a class called Product.
- Create an interface called IProductService.
- Create a class called ProductService.
- Modify HomeController to add a constructor that will inject IProductService.
- Create an action method called Products in HomeController.
- Create a view called Products.cshtml.
- Now, to use DryIoc, we will add the DryIoc and DryIoc.Dnx.DependencyInjection NuGet packages in project.json file's dependencies section. They will be downloaded automatically: