Skip to content
Kevin Bost edited this page Dec 21, 2018 · 2 revisions

AutoDI was designed to bring the same nice dependency injection framework that ASP.NET Core developers enjoy to other platforms. However, AutoDI can still offer compile time construction of the dependency injection registration calls to ASP.NET projects. You can enabled this with a couple NuGet packages and a single line of code.

  1. Install NuGet packages. PM> Install-Package AutoDI.Build and PM> Install-Package AutoDI.AspNetCore
  2. Invoke the UseAutoDI on your IWebHostBuilder (typically in your main method).
using AutoDI.AspNetCore

public static void Main(string[] args)
{
    IWebHost host = new WebHostBuilder()
        .UseAutoDI()
    ...
}