Last active
September 26, 2016 07:44
-
-
Save bcnzer/9abf6532bdcfc70920c420add00ac1a0 to your computer and use it in GitHub Desktop.
Example of a Startup configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
// This method gets called by the runtime. Use this method to add services to the container. | |
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 | |
public Startup(IHostingEnvironment env) | |
{ | |
var builder = new ConfigurationBuilder() | |
.SetBasePath(env.ContentRootPath) | |
.AddJsonFile("appsettings.json", true, true) | |
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", true) | |
.AddEnvironmentVariables(); | |
if (env.IsDevelopment()) | |
{ | |
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 | |
builder.AddUserSecrets(); | |
} | |
Configuration = builder.Build(); | |
} | |
// other code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment