From 99f263eac81acdc375e05be1055986ba56cb5791 Mon Sep 17 00:00:00 2001 From: Scott Addie Date: Mon, 2 Oct 2017 12:31:25 -0500 Subject: [PATCH] Modify code snippet --- aspnetcore/migration/1x-to-2x/index.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/aspnetcore/migration/1x-to-2x/index.md b/aspnetcore/migration/1x-to-2x/index.md index 545fd4db3c..e03a8fbe3b 100644 --- a/aspnetcore/migration/1x-to-2x/index.md +++ b/aspnetcore/migration/1x-to-2x/index.md @@ -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*: