Properties tagged with the framework IgnoreDataMemberAttribute should be ignored by the serializers. Due to a (perceived) issue in Newtonsoft JSON (Submitted here: https://github.com/JamesNK/Newtonsoft.Json/issues/943), we would need to use their own JsonIgnoreAttribute to effectively ignore a property. This contract resolver aims to correct that by adding support for the framework attribute.
More...
|
| RespectIgnoreDataMemberResolver () |
| Construct a contract resolve that ignores properties with the IgnoreDataMemberAttribute set on JSON serialization/deserialization.
|
|
|
override JsonProperty | CreateProperty (MemberInfo member, MemberSerialization memberSerialization) |
| Instantiates a JsonProperty for the specified member if it has not been excluded by the AllowMember predicate.
|
|
override List< MemberInfo > | GetSerializableMembers (Type objectType) |
| Gets the serializable members for the specified type, filtered by the configured predicate (if any). If the same type is requested multiple times for the same instance, performance is improved by returning a cached result.
|
|
|
Func< MemberInfo, bool > | AllowMember [get] |
| If specified on construction, only members that return true for this predicate will be serialized and instantiated on deserialization.
|
|
Properties tagged with the framework IgnoreDataMemberAttribute should be ignored by the serializers. Due to a (perceived) issue in Newtonsoft JSON (Submitted here: https://github.com/JamesNK/Newtonsoft.Json/issues/943), we would need to use their own JsonIgnoreAttribute to effectively ignore a property. This contract resolver aims to correct that by adding support for the framework attribute.
Definition at line 13 of file RespectIgnoreDataMemberResolver.cs.
◆ RespectIgnoreDataMemberResolver()
AnalyzeRe.JsonConverters.RespectIgnoreDataMemberResolver.RespectIgnoreDataMemberResolver |
( |
| ) |
|
|
inline |
Construct a contract resolve that ignores properties with the IgnoreDataMemberAttribute set on JSON serialization/deserialization.
Definition at line 18 of file RespectIgnoreDataMemberResolver.cs.
◆ CreateProperty()
override JsonProperty AnalyzeRe.JsonConverters.CachedContractResolver.CreateProperty |
( |
MemberInfo |
member, |
|
|
MemberSerialization |
memberSerialization |
|
) |
| |
|
sealedprotectedinherited |
Instantiates a JsonProperty for the specified member if it has not been excluded by the AllowMember predicate.
◆ GetSerializableMembers()
override List< MemberInfo > AnalyzeRe.JsonConverters.CachedContractResolver.GetSerializableMembers |
( |
Type |
objectType | ) |
|
|
sealedprotectedinherited |
Gets the serializable members for the specified type, filtered by the configured predicate (if any). If the same type is requested multiple times for the same instance, performance is improved by returning a cached result.
◆ AllowMember
Func<MemberInfo, bool> AnalyzeRe.JsonConverters.CachedContractResolver.AllowMember |
|
getinherited |
If specified on construction, only members that return true for this predicate will be serialized and instantiated on deserialization.
Definition at line 29 of file CachedContractResolver.cs.
The documentation for this class was generated from the following file: