zuohuaijun 4 năm trước cách đây
mục cha
commit
4fff158529

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

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