/// <summary>Gets a dictionary.</summary> /// /// <exception cref="ConfigurationErrorsException">Thrown when a Configuration Errors error condition occurs.</exception> /// /// <param name="key">The key.</param> /// /// <returns>The dictionary.</returns> 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); } }
/// <summary>Gets a list.</summary> /// /// <param name="key">The key.</param> /// /// <returns>The list.</returns> public virtual IList <string> GetList(string key) { var value = GetString(key); return(ConfigUtils.GetListFromAppSettingValue(value)); }