public Data_DB(string dirBase, typePermission_DB permission = typePermission_DB.Normal, bool useCache = true, string dbName = "") { _useCache_Realtime = useCache; _permissionDB = new Data_Permission(permission); //初始根目录 DirRoot = _configDataCache.config["DataCache.MemoryDB:Base_Dir"] + ""; if (DirRoot == "") { DirRoot = System.IO.Directory.GetCurrentDirectory(); } //默认路径数据库 if (dirBase != "") { DirBase = dirBase; DirRoot = Directory.GetDirectoryRoot(DirBase); } else { if (dbName == "") { return; } DirBase = DirRoot + dbName; } //创建数据库 if (DirBase != "") { this.OnDBModelCreating(); //初始日志库表 _dtLog = new DataTable_Log <DataModels_Log>(); this.InitDBModel(_dtLog); } }
/// <summary>注入数据库对象 /// </summary> /// <param name="dbContext"></param> public void SetDB(Data_DB dbContext) { _dbContext = dbContext; _permissionDB = dbContext.PermissionDB; }
public Data_Table(string dtName) { _permissionDB = new Data_Permission(); _dtName = dtName == null?this.GetType().Name : dtName; }
public Data_Table(typePermission_DB permission) { _permissionDB = new Data_Permission(permission); _dtName = this.GetType().Name; }
public Data_Table() { _permissionDB = new Data_Permission(); _dtName = this.GetType().Name; }