This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,7 @@ public static PropertyInfo[] GetPublicProperties(this Type type)
633
633
634
634
public const string DataMember = "DataMemberAttribute" ;
635
635
public const string IgnoreDataMember = "IgnoreDataMemberAttribute" ;
636
+ public const string JsonIgnoreMembar = "JsonIgnoreAttribute" ;
636
637
637
638
public static PropertyInfo [ ] GetSerializableProperties ( this Type type )
638
639
{
@@ -647,8 +648,12 @@ public static PropertyInfo[] GetSerializableProperties(this Type type)
647
648
648
649
// else return those properties that are not decorated with IgnoreDataMember
649
650
return publicReadableProperties
650
- . Where ( prop => prop . AllAttributes ( ) . All ( attr => attr . GetType ( ) . Name != IgnoreDataMember ) )
651
- . Where ( prop => ! JsConfig . ExcludeTypes . Contains ( prop . PropertyType ) )
651
+ . Where ( prop => prop . AllAttributes ( ) . All ( attr =>
652
+ {
653
+ var name = attr . GetType ( ) . Name ;
654
+ return name != IgnoreDataMember && name != JsonIgnoreMembar ;
655
+ } ) )
656
+ . Where ( prop => ! JsConfig . ExcludeTypes . Contains ( prop . PropertyType ) )
652
657
. ToArray ( ) ;
653
658
}
654
659
You can’t perform that action at this time.
0 commit comments