Skip to content

Instantly share code, notes, and snippets.

@csharpfritz
Created June 27, 2016 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csharpfritz/647618cc7ce75a639feb0e0dd5ddfc41 to your computer and use it in GitHub Desktop.
Save csharpfritz/647618cc7ce75a639feb0e0dd5ddfc41 to your computer and use it in GitHub Desktop.
ASP.NET Core Dependency Injection
public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddSingleton(Configuration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment