Getting ready

Dependency injection is now native in ASP.NET Core. Importing Microsoft.Extensions.DependencyInjection in project.json (formerly web.config), and by a using statement in Startup.cs (formerly global.asax), we can use this internal component to manage DI for our application, represented by the IServiceProvider interface.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.