/// <summary> /// 获取激活的上下文类型 /// </summary> /// <returns></returns> private IEnumerable <Type> GetActivateDbContextType() { var masterTypes = dbContextFactory.GetAllMasterType(); if (masterTypes == null || masterTypes.Count() <= 0) { throw new InvalidOperationException("当前无激活的上下文"); } return(masterTypes); }