From ad48e3727393546b3cd0da7eb12fa033f0731657 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 18 Mar 2024 15:09:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=9E=9A=E4=B8=BEcode=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Common/EnumSetting/EnumsController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Common/EnumSetting/EnumsController.cs b/Src/Dlhis.Common/EnumSetting/EnumsController.cs index fde3ebb5..f76610bf 100644 --- a/Src/Dlhis.Common/EnumSetting/EnumsController.cs +++ b/Src/Dlhis.Common/EnumSetting/EnumsController.cs @@ -33,8 +33,7 @@ public class EnumsController : ControllerBase { var types = Assembly.Load("Dlhis.Entity") .GetTypes() - .Where(x => x.IsEnum) - .WhereIf(code.IsPresent(), x => x.Name == code); + .Where(x => x.IsEnum); var result = types.Select(x => { @@ -78,7 +77,7 @@ public class EnumsController : ControllerBase result.Add(GetCurrentEnums("LogLevel", "日志级别", typeof(LogLevel))); - return result; + return result.WhereIf(code.IsPresent(), x => x.Code == code).ToList(); }