C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.JsonConverters.RespectIgnoreDataMemberResolver Class Reference

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...

Public Member Functions

 RespectIgnoreDataMemberResolver ()
 Construct a contract resolve that ignores properties with the IgnoreDataMemberAttribute set on JSON serialization/deserialization.
 

Protected Member Functions

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.
 

Properties

Func< MemberInfo, bool > AllowMember [get]
 If specified on construction, only members that return true for this predicate will be serialized and instantiated on deserialization.
 

Detailed Description

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.

Inheritance diagram for AnalyzeRe.JsonConverters.RespectIgnoreDataMemberResolver:
AnalyzeRe.JsonConverters.CachedContractResolver

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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.

Property Documentation

◆ 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: