From f4c3f82a3bd142bc555ec7f632dabc66ef86f5af Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期二, 19 八月 2025 16:51:45 +0800
Subject: [PATCH] 11
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs | 33 +++++++++++++++++++++------------
1 files changed, 21 insertions(+), 12 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
index ee96461..8357492 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
@@ -498,21 +498,30 @@
/// <returns></returns>
public virtual PageGridData<TEntity> QueryPage(string where, int pageIndex, int pageSize, Dictionary<string, OrderByType> orderBy)
{
- List<OrderByModel> orderByModels = new List<OrderByModel>();
- foreach (var item in orderBy)
+ try
{
- OrderByModel orderByModel = new OrderByModel()
+ List<OrderByModel> orderByModels = new List<OrderByModel>();
+ foreach (var item in orderBy)
{
- FieldName = item.Key,
- OrderByType = item.Value
- };
- orderByModels.Add(orderByModel);
- }
- int totalCount = 0;
- List<TEntity> list = _db.Queryable<TEntity>()
- .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize, ref totalCount);
+ OrderByModel orderByModel = new OrderByModel()
+ {
+ FieldName = item.Key,
+ OrderByType = item.Value
+ };
+ orderByModels.Add(orderByModel);
+ }
+ int totalCount = 0;
+ List<TEntity> list = _db.Queryable<TEntity>()
+ .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize, ref totalCount);
- return new PageGridData<TEntity>(totalCount, list);
+
+ return new PageGridData<TEntity>(totalCount, list);
+ }
+ catch (Exception ex)
+ {
+
+ throw;
+ }
}
/// <summary>
--
Gitblit v1.9.3