Modify code snippet

pull/4453/head
Scott Addie 2017-10-02 12:31:25 -05:00 committed by GitHub
parent 11de3f2054
commit 99f263eac8
1 changed files with 4 additions and 6 deletions

View File

@ -124,14 +124,12 @@ The preceding example loads the `Configuration` member with configuration settin
In 2.0 projects, the boilerplate configuration code inherent to 1.x projects runs behind-the-scenes. For example, environment variables and app settings are loaded at startup. The equivalent *Startup.cs* code is reduced to `IConfiguration` initialization with the injected instance:
```csharp
public class Startup
public Startup(IConfiguration configuration)
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public IConfiguration Configuration { get; }
```
To add configuration providers, invoke the `IWebHostBuilder.ConfigureAppConfiguration` method in *Program.cs*: