Esempio n. 1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="configuration">配置</param>
        public static void Initialize(Configuration configuration)
        {
            #region # 验证

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration), "配置不可为空!");
            }

            #endregion

            _Setting = (RedisSection)configuration.GetSection("sd.toolkits.redis");
        }
Esempio n. 2
0
        /// <summary>
        /// 静态构造器
        /// </summary>
        static RedisSection()
        {
            _Setting = (RedisSection)ConfigurationManager.GetSection("redisConfiguration");

            #region # 非空验证

            if (_Setting == null)
            {
                throw new ApplicationException("Redis节点未配置,请检查程序!");
            }

            #endregion
        }
Esempio n. 3
0
 /// <summary>
 /// 静态构造器
 /// </summary>
 static RedisSection()
 {
     _Setting = null;
 }