| | |
| | | |
| | | public virtual PageGridData<TEntity> GetPageData(PageDataOptions options) |
| | | { |
| | | string wheres = ValidatePageOptions(options); |
| | | string wheres = options.ValidatePageOptions(TProperties); |
| | | //鑾峰彇鎺掑簭瀛楁 |
| | | Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(TProperties); |
| | | |
| | | PageGridData<TEntity> pageGridData = new PageGridData<TEntity>(); |
| | | //if (QueryRelativeExpression != null) |
| | | //{ |
| | | // queryable = QueryRelativeExpression.Invoke(queryable); |
| | | //} |
| | | //if (options.Export) |
| | | //{ |
| | | // queryable = queryable.GetIQueryableOrderBy(orderbyDic); |
| | | // if (Limit > 0) |
| | | // { |
| | | // queryable = queryable.Take(Limit); |
| | | // } |
| | | // pageGridData.rows = queryable.ToList(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // pageGridData.rows = repository.IQueryablePage(queryable, |
| | | // options.Page, |
| | | // options.Rows, |
| | | // out int rowCount, |
| | | // orderbyDic).ToList(); |
| | | // pageGridData.total = rowCount; |
| | | // //鏌ヨ鐣岄潰缁熻姹傜瓑瀛楁 |
| | | // if (SummaryExpress != null) |
| | | // { |
| | | // pageGridData.summary = SummaryExpress.Invoke(queryable); |
| | | // //Func<T, T> groupExpress = x =>x; |
| | | // //pageGridData.summary = queryable.GroupBy(groupExpress).Select(SummaryExpress).FirstOrDefault(); |
| | | // } |
| | | //} |
| | | //GetPageDataOnExecuted?.Invoke(pageGridData); |
| | | |
| | | pageGridData = BaseDal.QueryPage |
| | | (wheres, options.Page, options.Rows, orderbyDic); |
| | | pageGridData = BaseDal.QueryPage(wheres, options.Page, options.Rows, orderbyDic); |
| | | |
| | | return pageGridData; |
| | | } |