예제 #1
0
        /// <summary>
        ///     压缩数据库
        /// </summary>
        /// <param name="dbIndex">数据库配置</param>
        public static void Compression(int dbIndex)
        {
            DbInfo dbInfo = dbIndex;

            Compression(ConnStringCacheManger.Cache(dbIndex), dbInfo.DataType);
        }
예제 #2
0
 /// <summary>
 ///     通过数据库配置,连接数据库
 /// </summary>
 /// <param name="dbIndex">数据库选项</param>
 protected DbContext(int dbIndex = 0) : this(ConnStringCacheManger.Cache(dbIndex), DbConfigs.ConfigEntity.DbList[dbIndex].DataType, DbConfigs.ConfigEntity.DbList[dbIndex].CommandTimeout, DbConfigs.ConfigEntity.DbList[dbIndex].DataVer)
 {
 }
예제 #3
0
        /// <summary>
        ///     返回数据库执行
        /// </summary>
        /// <param name="dbIndex">数据库配置项</param>
        /// <param name="tranLevel">开启事务等级</param>
        public static DbExecutor CreateDbExecutor(int dbIndex = 0, IsolationLevel tranLevel = IsolationLevel.ReadCommitted)
        {
            DbInfo dbInfo = dbIndex;

            return(new DbExecutor(ConnStringCacheManger.Cache(dbIndex), dbInfo.DataType, dbInfo.CommandTimeout, tranLevel));
        }
예제 #4
0
 /// <summary>
 ///     通过数据库配置,连接数据库
 /// </summary>
 /// <param name="dbIndex">数据库选项</param>
 /// <param name="isUnitOfWork">是否工作单元模式</param>
 public DbContext(int dbIndex = 0, bool isUnitOfWork = false) : this(ConnStringCacheManger.Cache(dbIndex), DbConfigs.ConfigEntity.DbList[dbIndex].DataType, DbConfigs.ConfigEntity.DbList[dbIndex].CommandTimeout, DbConfigs.ConfigEntity.DbList[dbIndex].DataVer, isUnitOfWork)
 {
 }