ShortenAndFilterPropertiesContractResolver
public class ShortenAndFilterPropertiesContractResolver : DefaultContractResolverInitializes a new instance of the contract resolver.
Constructors
Section titled “Constructors”
ShortenAndFilterPropertiesContractResolver(IEnumerable, Dictionary<string, string>)
Section titled “ShortenAndFilterPropertiesContractResolver(IEnumerable, Dictionary<string, string>)”public ShortenAndFilterPropertiesContractResolver(IEnumerable<string> propertiesToInclude = null, Dictionary<string, string> propertyNameMapping = null)Initializes a new instance of the contract resolver.
Parameters
| Name | Type | Description |
|---|---|---|
propertiesToInclude |
System.Collections.Generic.IEnumerable{System.String} | Optional list of property names to include. If null, all properties will be included. |
propertyNameMapping |
System.Collections.Generic.Dictionary{System.String,System.String} | Optional dictionary mapping original property names to desired short names. If null, property names will not be changed. |
Methods
Section titled “Methods”
CreateProperties(Type, MemberSerialization)
Section titled “CreateProperties(Type, MemberSerialization)”protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)Creates properties for the given Newtonsoft.Json.Serialization.JsonContract.
Parameters
| Name | Type | Description |
|---|---|---|
type |
System.Type | The type to create properties for. |
memberSerialization |
Newtonsoft.Json.MemberSerialization | The member serialization mode for the type. |
Returns
System.Collections.Generic.IList{Newtonsoft.Json.Serialization.JsonProperty} — Properties for the given Newtonsoft.Json.Serialization.JsonContract.