Class JsonObjectSerializer
Used for serialization of object to/from JSON format.
Inheritance
System.Object
JsonObjectSerializer
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Framework.Serialization.Json
Assembly: EPiServer.Framework.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(IObjectSerializer))]
public class JsonObjectSerializer : IObjectSerializer
Constructors
JsonObjectSerializer()
Initializes a new instance of the JsonObjectSerializer class.
Declaration
public JsonObjectSerializer()
JsonObjectSerializer(IEnumerable<JsonConverter>, IContractResolver)
Initializes a new instance of the JsonObjectSerializer class.
Declaration
public JsonObjectSerializer(IEnumerable<JsonConverter> converters, IContractResolver resolver)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Newtonsoft.Json.JsonConverter> | converters | The json converters. |
Newtonsoft.Json.Serialization.IContractResolver | resolver | The json contract resolver |
Properties
HandledContentTypes
Gets the handled content types for this serializer.
Declaration
public IEnumerable<string> HandledContentTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The handled content types. |
Methods
Deserialize(TextReader, Type)
Deserializes the object using the specified reader.
Declaration
public object Deserialize(TextReader reader, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader | The reader. |
System.Type | objectType | Type of the object. |
Returns
Type | Description |
---|---|
System.Object | The serialized object. |
Deserialize<T>(TextReader)
Deserializes the object using the specified reader.
Declaration
public T Deserialize<T>(TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader | The reader. |
Returns
Type | Description |
---|---|
T | The serialized object. |
Type Parameters
Name | Description |
---|---|
T | The System.Type of the object to deserialize. |
Serialize(TextWriter, Object)
Serializes an object using the specified text writer.
Declaration
public void Serialize(TextWriter textWriter, object value)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | textWriter | The text writer. |
System.Object | value | The object value. |