DbContext getDbContext(string manageName) { var dbLocation = new CRL.DBLocation() { DataAccessType = DataAccessType.Default, ManageType = GetType(), ManageName = manageName }; var helper = SettingConfig.GetDBAccessBuild(dbLocation).GetDBHelper(); var dbContext = new DbContext(helper, dbLocation); return(dbContext); }
DbContext getDbContext() { var dbLocation = new CRL.DBLocation() { DataAccessType = DataAccessType.Read, ManageType = typeof(T) }; var helper = SettingConfig.GetDBAccessBuild(dbLocation).GetDBHelper(); var dbContext = new DbContext(helper, dbLocation); return(dbContext); }
internal override DbContext GetDbContext() { //if (SettingConfig.DbAccessCreaterCache.Count == 0) //{ // throw new CRLException("请配置CRL数据访问对象,实现CRL.SettingConfig.GetDbAccess"); //} dbLocation.ManageName = ManageName; var helper = SettingConfig.GetDBAccessBuild(dbLocation).GetDBHelper(); var dbContext = new DbContext(helper, dbLocation); dbContext.UseSharding = true; return(dbContext); }