Created
February 16, 2022 22:14
-
-
Save CalvinAllen/7229589af1e25dddf8eccbe114d8b994 to your computer and use it in GitHub Desktop.
Using ConfigurationBuilder
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
var configBuilder = new ConfigurationBuilder() | |
.SetBasePath(Directory.GetCurrentDirectory()) | |
.AddJsonFile($"appsettings.{environment}.json", optional: true); | |
if (environment == EnvironmentEnum.LocalDevelopment) | |
{ | |
configBuilder.AddUserSecrets<Function>(optional: true); | |
} | |
configBuilder.AddEnvironmentVariables(); | |
var configuration = configBuilder.Build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment