/// <summary> /// 生成一个范围 /// </summary> /// <param name="table">数据库对象</param> /// <returns>范围</returns> public static DataTableScope CreateScope(IDataTable table) { var scope = new DataTableScope(table) { _isHereOpen = table.OriDataBase == null }; if (scope._isHereOpen) { //table.DataBase.Open(); } table.DataBase.QuoteCount += 1; return(scope); }
/// <summary> /// 生成一个范围 /// </summary> /// <param name="table">数据库对象</param> /// <returns>范围</returns> public static Task <DataTableScope> CreateScopeAsync(IDataTable table) { var scope = new DataTableScope(table); return(scope.CreateScope()); }