From 46e60a62ec88c5620865163ed00d037d770d9b2c Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期二, 05 八月 2025 13:52:47 +0800
Subject: [PATCH] pref:优化

---
 FlexJobApi.Core/Utils/PagedListUtils/PagedListUtils.cs |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/FlexJobApi.Core/Utils/PagedListUtils/PagedListUtils.cs b/FlexJobApi.Core/Utils/PagedListUtils/PagedListUtils.cs
index 3ff720c..5bb58e6 100644
--- a/FlexJobApi.Core/Utils/PagedListUtils/PagedListUtils.cs
+++ b/FlexJobApi.Core/Utils/PagedListUtils/PagedListUtils.cs
@@ -51,12 +51,13 @@
             var entityType = typeof(T);
             int index = 0;
 
+            var props = entityType.GetProperties();
             foreach (var order in orders)
             {
                 if (string.IsNullOrEmpty(order.Property)) continue;
 
                 // 鑾峰彇鎺掑簭瀛楁鐨勫睘鎬т俊鎭�
-                var propertyInfo = entityType.GetProperty(order.Property);
+                var propertyInfo = props.FirstOrDefault(it => it.Name.Equals(order.Property, StringComparison.OrdinalIgnoreCase));
                 if (propertyInfo == null) throw Oops.Oh(EnumErrorCodeType.s404, $"璇ユ帓搴忓瓧娈祘order.Property}");
 
                 // 鍒涘缓琛ㄨ揪寮忔爲
@@ -68,15 +69,15 @@
                 if (index == 0)
                 {
                     // 棣栨鎺掑簭
-                    methodName = order.Order == EnumPagedListOrder.Ascending 
-                        ? "OrderBy" 
+                    methodName = order.Order == EnumPagedListOrder.Ascending
+                        ? "OrderBy"
                         : "OrderByDescending";
                 }
                 else
                 {
                     // 浜屾鍙婁互鍚庢帓搴�
-                    methodName = order.Order == EnumPagedListOrder.Ascending 
-                        ? "ThenBy" 
+                    methodName = order.Order == EnumPagedListOrder.Ascending
+                        ? "ThenBy"
                         : "ThenByDescending";
                 }
 

--
Gitblit v1.9.1