Forráskód Böngészése

Merge commit 'refs/pull/345/head' of https://gitee.com/zuohuaijun/Admin.NET into next

zuohuaijun 4 éve
szülő
commit
c6d5a00c5d
1 módosított fájl, 12 hozzáadás és 2 törlés
  1. 12 2
      Admin.NET/Admin.NET.Core/Extension/ObjectExtension.cs

+ 12 - 2
Admin.NET/Admin.NET.Core/Extension/ObjectExtension.cs

@@ -122,7 +122,17 @@ public static class ObjectExtension
     /// <returns></returns>
     private static bool IsIgnoreColumn(PropertyInfo pi)
     {
-        var sc = pi.GetCustomAttributes<SugarColumn>(false).FirstOrDefault(u => u.IsIgnore == true);
-        return sc != null;
+        foreach (var attr in pi.GetCustomAttributes())
+        {
+            if (attr is SugarColumn sAttr && sAttr.IsIgnore)
+            {
+                return true;
+            }
+            if (attr is Navigate)
+            {
+                return true;
+            }
+        }
+        return false;
     }
 }