public static async IAsyncEnumerable <KeyValuePair <string, string> > LoadToolConfig(string path) { if (!File.Exists(path)) { yield break; } await foreach (KeyValuePair <string, string> item in BaseConfig.LoadFromFile(path, SEPARATOR)) { yield return(new KeyValuePair <string, string>(item.Key, item.Value)); } }
public static async Task <Dictionary <string, string> > LoadEnviroinmentVars(string path) { Dictionary <string, string> result = _enviroinmentVariables .ToDictionary(x => x.Key, x => x.Value); if (!File.Exists(path)) { return(result); } await foreach (KeyValuePair <string, string> item in BaseConfig.LoadFromFile(path)) { result[item.Key] = item.Value; } return(result); }