Table of Contents

Class NewtonsoftJsonMarshaller

Namespace
Savvyio.Extensions.Newtonsoft.Json
Assembly
Savvyio.Extensions.Newtonsoft.Json.dll

Provides a class for marshalling data using the Newtonsoft JSON library.

public class NewtonsoftJsonMarshaller : IMarshaller
Inheritance
NewtonsoftJsonMarshaller
Implements

Constructors

NewtonsoftJsonMarshaller(Action<NewtonsoftJsonFormatterOptions>)

Initializes a new instance of the NewtonsoftJsonMarshaller class.

public NewtonsoftJsonMarshaller(Action<NewtonsoftJsonFormatterOptions> setup = null)

Parameters

setup Action<NewtonsoftJsonFormatterOptions>

The NewtonsoftJsonFormatterOptions which need to be configured.

Properties

Default

Provides a default instance of the NewtonsoftJsonMarshaller class optimized for messaging.

public static NewtonsoftJsonMarshaller Default { get; }

Property Value

NewtonsoftJsonMarshaller

The default instance of the NewtonsoftJsonMarshaller class optimized for messaging.

Methods

Create(Action<NewtonsoftJsonFormatterOptions>)

Creates a new instance of the NewtonsoftJsonMarshaller class.

public static NewtonsoftJsonMarshaller Create(Action<NewtonsoftJsonFormatterOptions> setup = null)

Parameters

setup Action<NewtonsoftJsonFormatterOptions>

The NewtonsoftJsonFormatterOptions which may be configured.

Returns

NewtonsoftJsonMarshaller

JsonMarshaller.

Deserialize(Stream, Type)

Deserializes the specified data into an object of returnType.

public object Deserialize(Stream data, Type returnType)

Parameters

data Stream

The string from which to deserialize the object graph.

returnType Type

The type of the deserialized object.

Returns

object

An object of returnType.

Deserialize<TValue>(Stream)

Deserializes the specified data into an object of TValue.

public TValue Deserialize<TValue>(Stream data)

Parameters

data Stream

The object from which to deserialize the object graph.

Returns

TValue

An object of TValue.

Type Parameters

TValue

The type of the object to return.

Serialize(object, Type)

Serializes the specified value to an object of Stream.

public Stream Serialize(object value, Type inputType)

Parameters

value object

The object to serialize to Stream format.

inputType Type

The type of the object to serialize.

Returns

Stream

A Stream of the serialized value.

Serialize<TValue>(TValue)

Serializes the specified value to an object of Stream.

public Stream Serialize<TValue>(TValue value)

Parameters

value TValue

The object to serialize to Stream format.

Returns

Stream

A Stream of the serialized value.

Type Parameters

TValue

See Also