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...
|
| CachedContractResolver (Func< MemberInfo, bool > allowMember=null) |
| Construct a CachedContractResolver, optionally configured to return a filtered subset of the base serializable members.
|
|
|
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.
|
|
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.
◆ 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.
◆ 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.
◆ 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: