Skip to content

Instantly share code, notes, and snippets.

@m-malkowski
Created June 18, 2018 09:33
Show Gist options
  • Select an option

  • Save m-malkowski/5bb6f2d55c1c7d2bef7011716c35f98d to your computer and use it in GitHub Desktop.

Select an option

Save m-malkowski/5bb6f2d55c1c7d2bef7011716c35f98d to your computer and use it in GitHub Desktop.
Working with built-in dependency injection of ASP .NET Core - Final Startup
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseInMemoryDatabase()
);
// Add framework services.
services.AddMvc();
// Register application services.
services.AddInjectionByAttribute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment