Skip to content

Instantly share code, notes, and snippets.

@benwillkommen
Created June 24, 2016 15:42
Show Gist options
  • Save benwillkommen/53fde05bb3a0d12f8388a1a2fa0622ea to your computer and use it in GitHub Desktop.
Save benwillkommen/53fde05bb3a0d12f8388a1a2fa0622ea to your computer and use it in GitHub Desktop.
non web.config config
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