Пример #1
0
        internal DBHelper GetDBHelper(DataAccessType accessType = DataAccessType.Default)
        {
            DBLocation.DataAccessType = accessType;
            var helper = DBConfigRegister.GetDBHelper(DBLocation);

            return(helper);
        }
Пример #2
0
        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
        }
Пример #3
0
        internal override DbContextInner GetDbContext()
        {
            dbLocation.ManageName = ManageName;
            var helper    = DBConfigRegister.GetDBHelper(dbLocation);
            var dbContext = new DbContextInner(helper, dbLocation);

            return(dbContext);
        }
Пример #4
0
        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));
        }
Пример #5
0
 static SettingConfig()
 {
     var builder = DBConfigRegister.GetInstance();
 }
Пример #6
0
 public static AbsDBExtend CreateDBExtend(DbContextInner _dbContext)
 {
     return(DBConfigRegister.CreateDBExtend(_dbContext));
 }