Skip to content

Instantly share code, notes, and snippets.

@conectado
Created January 24, 2018 00:20
Show Gist options
  • Select an option

  • Save conectado/82771b08dabd85157e4f711971f3cfc4 to your computer and use it in GitHub Desktop.

Select an option

Save conectado/82771b08dabd85157e4f711971f3cfc4 to your computer and use it in GitHub Desktop.
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);
if (env.IsDevelopment())
{
builder.AddUserSecrets<Startup>();
}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment