Skip to content

Instantly share code, notes, and snippets.

@shcyiza
Last active January 23, 2020 18:16
Show Gist options
  • Save shcyiza/42fb5554df8de72ecd229d5095d2b26d to your computer and use it in GitHub Desktop.
Save shcyiza/42fb5554df8de72ecd229d5095d2b26d to your computer and use it in GitHub Desktop.
access env var in dotnet core
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"Jwt": {
"Key": "veryVerySecretKey",
"Issuer": "auth_server_brx"
}
}
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"Jwt": {
"Key": "veryVerySecretKey",
"Issuer": "auth_server_brx"
}
}
public Startup(IConfiguration configuration)
{
Configuration = configuration;
StaticConfig = configuration;
}
public static IConfiguration Env { get; private set; }
// to use simply call the static member from anywher in the app
// Startup.Env["Jwt:issuer"]
public Startup(IConfiguration configuration)
{
Configuration = configuration;
StaticConfig = configuration;
}
public static IConfiguration Env { get; private set; }
// to use simply call the static member from anywher in the app
// Startup.Env["Jwt:issuer"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment