示例#1
0
        /// <summary>
        /// sectionName
        /// </summary>
        /// <param name="sectionName">sectionName</param>
        /// <returns>RedisSettings</returns>
        public static RedisSettings GetConfig(string sectionName)
        {
            RedisSettings section = (RedisSettings)ConfigurationManager.GetSection(sectionName);

            if (section == null)
            {
                throw new ConfigurationErrorsException("Section " + sectionName + " is not found.");
            }
            return(section);
        }
示例#2
0
        /// <summary>
        /// GetConfig
        /// </summary>
        /// <returns>RedisSettings</returns>
        public static RedisSettings GetConfig()
        {
            RedisSettings section = GetConfig(RedisMappingConstants.RedisConfiguration);

            return(section);
        }