Table of Contents

Class JsonNetSerializer

Namespace
JWT.Serializers
Assembly
Coherence.JWT.dll

JSON serializer using Newtonsoft.Json implementation.

public class JsonNetSerializer : IJsonSerializer
Inheritance
JsonNetSerializer
Implements
Extension Methods

Constructors

JsonNetSerializer()

Creates a new instance of JsonNetSerializer

public JsonNetSerializer()

Remarks

Uses Newtonsoft.Json.JsonSerializer.CreateDefault as internal serializer

Exceptions

ArgumentNullException

JsonNetSerializer(JsonSerializer)

Creates a new instance of JsonNetSerializer

public JsonNetSerializer(JsonSerializer serializer)

Parameters

serializer JsonSerializer

Internal Newtonsoft.Json.JsonSerializer to use for serialization

Exceptions

ArgumentNullException

Methods

Deserialize(Type, string)

Deserializes a JSON string to an object of specified type.

public object Deserialize(Type type, string json)

Parameters

type Type

The type of the object to deserialize to.

json string

The JSON string deserialize.

Returns

object

Strongly-typed object.

Exceptions

ArgumentNullException
ArgumentException

Serialize(object)

Serializes an object to a JSON string.

public string Serialize(object obj)

Parameters

obj object

The object to serialize.

Returns

string

JSON string

Exceptions

ArgumentNullException