public (bool IsSet, object Value) GetValue(Type type, string category, string name) { var variableName = $"{category}.{name}".ToUpperInvariant(); return(!_args.ContainsKey(variableName.ToUpperInvariant()) ? (false, ConfigSourceHelper.GetDefault(type)) : (true, ConfigSourceHelper.ParseValue(type, _args[variableName]))); }
public (bool IsSet, object Value) GetValue(Type type, string category, string name) { var variableName = $"NETHERMIND_{category.ToUpperInvariant()}_{name.ToUpperInvariant()}"; var variableValueString = Environment.GetEnvironmentVariable(variableName); return(string.IsNullOrWhiteSpace(variableValueString) ? (false, ConfigSourceHelper.GetDefault(type)) : (true, ConfigSourceHelper.ParseValue(type, variableValueString))); }
public (bool IsSet, object Value) GetValue(Type type, string category, string name) { if (!_values.ContainsKey(category) || !_values[category].ContainsKey(name)) { return(false, ConfigSourceHelper.GetDefault(type)); } if (!_parsedValues[category].ContainsKey(name)) { ParseValue(type, category, name); } return(true, _parsedValues[category][name]); }
public (bool IsSet, object Value) GetValue(Type type, string category, string name) { (bool isSet, string value) = GetRawValue(category, name); return(isSet, isSet ? ConfigSourceHelper.ParseValue(type, value) : ConfigSourceHelper.GetDefault(type)); }