From 4950d547503c7c1d5d0ff6487e6768937170ddf7 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期一, 04 八月 2025 17:29:00 +0800 Subject: [PATCH] feat:角色授权 --- 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