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);
            }
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
 public IDictionary <string, string> GetDictionary(string key)
 {
     return(ConfigUtils.GetDictionaryFromAppSetting(key));
 }
Beispiel #4
0
 public IList <string> GetList(string key)
 {
     return(ConfigUtils.GetListFromAppSetting(key));
 }
Beispiel #5
0
 public string GetString(string name)
 {
     return(ConfigUtils.GetNullableAppSetting(name));
 }
        public virtual IList <string> GetList(string key)
        {
            var value = GetString(key);

            return(ConfigUtils.GetListFromAppSettingValue(value));
        }