Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AwsContext
- {
- internal string Foo { get; private set; }
- internal string Bar { get; private set; }
- internal string Etc { get; private set; }
- internal static AwsContext LoadContext() {
- AwsContext context;
- if (bool.TryParse(Environment.GetEnvironmentVariable("use_env_context"), out isEnvContext) && isEnvContext)
- {
- context = AwsContext();
- context.LoadEnvContext();
- }
- else
- {
- context = AwsContext.LoadJsonContext();
- }
- return context;
- }
- internal AwsContext LoadEnvContext()
- {
- Foo = GoGet("Foo");
- Bar = GoGet("Bar");
- Etc = GoGet("Etc");
- LogValues();
- }
- internal static AwsContext LoadJsonContext()
- {
- var context = Json.Deserialize<AwsContext>(File.ReadAllText(Paths.AwsContextFile));
- context.LogValues();
- return context;
- }
- }
- MainServiceCore
- {
- context.AwsContext = AwsContext.LoadContext();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement