Пример #1
0
        private void ResetMasterSlaveContextConfig()
        {
            DbMasterSlaveConfigContext newConfig = new DbMasterSlaveConfigContext(this._contextType);
            DbMasterSlaveConfigContext oldConfig = this._config;

            this._config        = newConfig;
            this._taskIsRunning = false;

            if (oldConfig != null)
            {
                oldConfig.Dispose();
            }
        }
Пример #2
0
 /// <summary>
 /// 初始化类型 <see cref="DbServerStateScanner"/> 的新实例。
 /// </summary>
 internal DbServerStateScanner(DbMasterSlaveConfigContext config)
     : this()
 {
     Check.NotNull(config);
     this._config = config;
 }
Пример #3
0
 /// <summary>
 /// 以指定的 EF 数据库主从读写分离配置上下文对象作为 <see cref="Config"/> 属性值初始化类型 <see cref="DbMasterSlaveConnectionInterceptor"/> 的新实例。
 /// </summary>
 /// <param name="config"></param>
 internal DbMasterSlaveConnectionInterceptor(DbMasterSlaveConfigContext config)
 {
     Check.NotNull(config);
     this._config = config;
 }
 /// <summary>
 /// 初始化类型 <see cref="DbServerStateScanner"/> 的新实例。
 /// </summary>
 internal DbServerStateScanner(DbMasterSlaveConfigContext config)
     : this()
 {
     Check.NotNull(config);
     this._config = config;
 }
        private void ResetMasterSlaveContextConfig()
        {
            DbMasterSlaveConfigContext newConfig = new DbMasterSlaveConfigContext(this._contextType);
            DbMasterSlaveConfigContext oldConfig = this._config;

            this._config = newConfig;
            this._taskIsRunning = false;

            if (oldConfig != null)
            {
                oldConfig.Dispose();
            }
        }
 /// <summary>
 /// 以指定的 EF 数据库主从读写分离配置上下文对象作为 <see cref="Config"/> 属性值初始化类型 <see cref="DbMasterSlaveConnectionInterceptor"/> 的新实例。
 /// </summary>
 /// <param name="config"></param>
 internal DbMasterSlaveConnectionInterceptor(DbMasterSlaveConfigContext config)
 {
     Check.NotNull(config);
     this._config = config;
 }