Table of Contents

Class NewtonsoftJsonFormatter

Namespace
Cuemon.Extensions.Newtonsoft.Json.Formatters
Assembly
Cuemon.Extensions.Newtonsoft.Json.dll

Serializes and deserializes an object, in JSON format.

public class NewtonsoftJsonFormatter : StreamFormatter<NewtonsoftJsonFormatterOptions>, IConfigurable<NewtonsoftJsonFormatterOptions>
Inheritance
Object
Formatter<Stream>
NewtonsoftJsonFormatter
Implements
Inherited Members

Constructors

NewtonsoftJsonFormatter()

Initializes a new instance of the NewtonsoftJsonFormatter class.

public NewtonsoftJsonFormatter()

NewtonsoftJsonFormatter(NewtonsoftJsonFormatterOptions)

Initializes a new instance of the NewtonsoftJsonFormatter class.

public NewtonsoftJsonFormatter(NewtonsoftJsonFormatterOptions options)

Parameters

options NewtonsoftJsonFormatterOptions

The configured NewtonsoftJsonFormatterOptions.

NewtonsoftJsonFormatter(Action<NewtonsoftJsonFormatterOptions>)

Initializes a new instance of the NewtonsoftJsonFormatter class.

public NewtonsoftJsonFormatter(Action<NewtonsoftJsonFormatterOptions> setup)

Parameters

setup Action<NewtonsoftJsonFormatterOptions>

The NewtonsoftJsonFormatterOptions which need to be configured.

Methods

Deserialize(Stream, Type)

Deserializes the specified value into an object of objectType.

public override object Deserialize(Stream value, Type objectType)

Parameters

value Stream

The string from which to deserialize the object graph.

objectType Type

The type of the deserialized object.

Returns

Object

An object of objectType.

Serialize(Object, Type)

Serializes the specified source to an object of System.IO.Stream.

public override Stream Serialize(object source, Type objectType)

Parameters

source Object

The object to serialize to JSON format.

objectType Type

The type of the object to serialize.

Returns

Stream

A string of the serialized source.

See Also

StreamFormatter<TOptions>
JsonConverter