Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Created May 12, 2018 13:56
Show Gist options
  • Save jesuscampos/60ff60bea7b136dde96eecc9d9f392eb to your computer and use it in GitHub Desktop.
Save jesuscampos/60ff60bea7b136dde96eecc9d9f392eb to your computer and use it in GitHub Desktop.
Dependency Injection to be available in Startup constructor
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureServices(services =>
services.AddScoped<IMyClass, MyClass>()
.UseStartup<Startup>()
.Build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment