示例#1
0
        public virtual IDictionary <string, string> GetDictionary(string key)
        {
            var value = GetString(key);

            try
            {
                return(ConfigUtils.GetDictionaryFromAppSettingValue(value));
            }
            catch (Exception ex)
            {
                var message =
                    string.Format(
                        "The {0} setting had an invalid dictionary format. The correct format is of type \"Key1:Value1,Key2:Value2\"",
                        key);
                throw new ConfigurationErrorsException(message, ex);
            }
        }
示例#2
0
        public virtual IList <string> GetList(string key)
        {
            var value = GetString(key);

            return(ConfigUtils.GetListFromAppSettingValue(value));
        }