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

A wrapper for the basic DefaultContractResolver which caches the set of members to be serialized for a given base type, speeding up subsequent calls, and also provides an interface for filtering members (caching that result as well). More...

Public Member Functions

 CachedContractResolver (Func< MemberInfo, bool > allowMember=null)
 Construct a CachedContractResolver, optionally configured to return a filtered subset of the base serializable members.
 

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

A wrapper for the basic DefaultContractResolver which caches the set of members to be serialized for a given base type, speeding up subsequent calls, and also provides an interface for filtering members (caching that result as well).

Because member results are cached for the current instance, any changes to the configuration options of the base DefaultContractResolver should be done a single time before use.

Definition at line 19 of file CachedContractResolver.cs.

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

Constructor & Destructor Documentation

◆ CachedContractResolver()

AnalyzeRe.JsonConverters.CachedContractResolver.CachedContractResolver ( Func< MemberInfo, bool >  allowMember = null)
inline

Construct a CachedContractResolver, optionally configured to return a filtered subset of the base serializable members.

Parameters
allowMember(Optional) If specified, only members that return true for this predicate will be serialized and instantiated on deserialization.

Definition at line 36 of file CachedContractResolver.cs.

Member Function Documentation

◆ CreateProperty()

override JsonProperty AnalyzeRe.JsonConverters.CachedContractResolver.CreateProperty ( MemberInfo  member,
MemberSerialization  memberSerialization 
)
sealedprotected

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)
sealedprotected

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
get

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: