public virtual List <KeyValuePair <string, string> > GetKeyValuePairs(string key) { var value = GetString(key); try { return(ConfigUtils.GetKeyValuePairsFromAppSettingValue(value)); } catch (Exception ex) { var message = $"The {key} setting had an invalid Key/Value format: \"Key1:Value1,Key2:Value2\""; throw new ConfigurationErrorsException(message, ex); } }
public virtual IDictionary <string, string> GetDictionary(string key) { try { var value = Get(key); return(ConfigUtils.GetDictionaryFromAppSettingValue(value)); } catch (Exception ex) { var message = $"The {key} setting had an invalid dictionary format. " + $"The correct format is of type \"Key1:Value1,Key2:Value2\""; throw new ConfigurationErrorsException(message, ex); } }
public IDictionary <string, string> GetDictionary(string key) { return(ConfigUtils.GetDictionaryFromAppSetting(key)); }
public IList <string> GetList(string key) { return(ConfigUtils.GetListFromAppSetting(key)); }
public string GetString(string name) { return(ConfigUtils.GetNullableAppSetting(name)); }
public virtual IList <string> GetList(string key) { var value = GetString(key); return(ConfigUtils.GetListFromAppSettingValue(value)); }