internal DBHelper GetDBHelper(DataAccessType accessType = DataAccessType.Default) { DBLocation.DataAccessType = accessType; var helper = DBConfigRegister.GetDBHelper(DBLocation); return(helper); }
static DBConfigRegister() { instance = new DBConfigRegister(); #region 注册默认数据库类型 var configBuilder = instance; configBuilder.RegisterDBType(DBType.MSSQL, (dBAccessBuild) => { return(new SqlHelper(dBAccessBuild)); }, (context) => { return(new DBAdapter.MSSQLDBAdapter(context)); }); configBuilder.RegisterDBType(DBType.MSSQL2000, (dBAccessBuild) => { return(new Sql2000Helper(dBAccessBuild)); }, (context) => { return(new DBAdapter.MSSQL2000DBAdapter(context)); }); configBuilder.RegisterDBExtend <CRL.DBExtend.RelationDB.DBExtend>(DBType.MSSQL, (context) => { return(new DBExtend.RelationDB.DBExtend(context)); }); configBuilder.RegisterLambdaQueryType(DBType.MSSQL, typeof(RelationLambdaQuery <>)); #endregion }
internal override DbContextInner GetDbContext() { dbLocation.ManageName = ManageName; var helper = DBConfigRegister.GetDBHelper(dbLocation); var dbContext = new DbContextInner(helper, dbLocation); return(dbContext); }
internal AbsDBExtend copyDBExtend() { var helper = DBConfigRegister.GetDBHelper(dbContext.DBLocation); var dbContext2 = new DbContextInner(helper, dbContext.DBLocation); //dbContext2.ShardingMainDataIndex = dbContext.ShardingMainDataIndex; dbContext2.UseSharding = dbContext.UseSharding; return(DBExtendFactory.CreateDBExtend(dbContext2)); }
static SettingConfig() { var builder = DBConfigRegister.GetInstance(); }
public static AbsDBExtend CreateDBExtend(DbContextInner _dbContext) { return(DBConfigRegister.CreateDBExtend(_dbContext)); }