Created
June 24, 2016 15:42
-
-
Save benwillkommen/53fde05bb3a0d12f8388a1a2fa0622ea to your computer and use it in GitHub Desktop.
non web.config config
This file contains hidden or 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
using System; | |
namespace ConsoleApplication1 | |
{ | |
public static class SosConfig | |
{ | |
public static string CatalogApiUrl | |
{ | |
get | |
{ | |
var envValue = Environment.GetEnvironmentVariable("SosConfig.CatalogApiUrl"); | |
return string.IsNullOrEmpty(envValue) ? "https://dev.jockey.com/api/catalog" : envValue; | |
} | |
} | |
//a bunch of more properties... | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(SosConfig.CatalogApiUrl); | |
Environment.SetEnvironmentVariable("SosConfig.CatalogApiUrl", "https://en.sosjdc.briefsqa.com/api/catalog"); | |
Console.WriteLine(SosConfig.CatalogApiUrl); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment