From 595332d4f2b04bd9c502286a45becb496b15717e Mon Sep 17 00:00:00 2001 From: Scott Addie Date: Mon, 2 Oct 2017 10:01:20 -0500 Subject: [PATCH] Dedent code sample --- aspnetcore/migration/1x-to-2x/index.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/aspnetcore/migration/1x-to-2x/index.md b/aspnetcore/migration/1x-to-2x/index.md index df6de7de8b..358e4ea066 100644 --- a/aspnetcore/migration/1x-to-2x/index.md +++ b/aspnetcore/migration/1x-to-2x/index.md @@ -107,17 +107,16 @@ In 1.x projects, adding configuration providers to an application was done durin ```csharp public Startup(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) - .AddEnvironmentVariables(); - Configuration = builder.Build(); - } - -public IConfigurationRoot Configuration { get; } +{ + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); +} +public IConfigurationRoot Configuration { get; } ``` The above example loads the `Configuration` member with environment variables supplied in *launchSettings.json* and configuration settings from *appsettings.json* as well as any appsettings file that matches the `EnvironmentName` property provided in `IHostingEnvironment`. The location of these files would be at the same path as `Startup.cs`