/// <summary> /// 以指定的 <see cref="ApplyItemSection"/> 配置信息初始化类型 <see cref="DbMasterSlaveConfigContext"/> 的新实例。 /// </summary> /// <param name="applyItem"></param> internal DbMasterSlaveConfigContext(ApplyItemElement applyItem) : this() { Check.NotNull(applyItem); this._applyItem = applyItem; this.InitializeProperties(); }
private bool ValidateApplyItemSection(ConfigurationElement element) { var key = this.GetElementKey(element); ApplyItemElement applyItem = (ApplyItemElement)BaseGet(key); if (applyItem != null && applyItem.TargetContextFullName != ((ApplyItemElement)element).TargetContextFullName) { throw new InvalidOperationException(string.Format("EF 读写分离服务配置中已经存在表示相同 {0} 的配置项。", applyItem.TargetContextFullName)); } return(applyItem != null); }