Class ContractResolver
Json contract resolver which is aware of injected properties
Inheritance
System.Object
ContractResolver
Namespace: EPiServer.Framework.Serialization.Json
Assembly: EPiServer.Framework.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(IContractResolver))]
public class ContractResolver : CamelCasePropertyNamesContractResolver
Constructors
ContractResolver()
Declaration
public ContractResolver()
Methods
CreateProperty(MemberInfo, MemberSerialization)
Creates a Newtonsoft.Json.Serialization.JsonProperty for the given System.Reflection.MemberInfo.
Declaration
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | member | The member to create a Newtonsoft.Json.Serialization.JsonProperty for. |
Newtonsoft.Json.MemberSerialization | memberSerialization | The member's parent Newtonsoft.Json.MemberSerialization. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Serialization.JsonProperty | A created Newtonsoft.Json.Serialization.JsonProperty for the given System.Reflection.MemberInfo. |
ResolvePropertyName(String)
Resolves the name of the property.
Declaration
protected override string ResolvePropertyName(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property. |
Returns
Type | Description |
---|---|
System.String | The property name camel cased. |
Remarks
Overrides the default camel case converter in JSON.NET. E.g XHTML_ is converted into xhtml_ instead of xhtmL_
ToCamelCase(String)
Converts the string to a camel cased string
Declaration
protected virtual string ToCamelCase(string input)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The input to camel case. |
Returns
Type | Description |
---|---|
System.String | The input in camel cased format |