Table of Contents

Class JsonMarshaller

Namespace
Savvyio.Extensions.Text.Json
Assembly
Savvyio.Extensions.Text.Json.dll

Provides a class for marshalling data using native JSON support in .NET.

public class JsonMarshaller : IMarshaller
Inheritance
JsonMarshaller
Implements

Constructors

JsonMarshaller(Action<JsonFormatterOptions>)

Initializes a new instance of the JsonMarshaller class.

public JsonMarshaller(Action<JsonFormatterOptions> setup = null)

Parameters

setup Action<JsonFormatterOptions>

The JsonFormatterOptions which may be configured.

Properties

Default

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

public static JsonMarshaller Default { get; }

Property Value

JsonMarshaller

The default instance of the JsonMarshaller class optimized for messaging.

Methods

Create(Action<JsonFormatterOptions>)

Creates a new instance of the JsonMarshaller class.

public static JsonMarshaller Create(Action<JsonFormatterOptions> setup = null)

Parameters

setup Action<JsonFormatterOptions>

The JsonFormatterOptions which may be configured.

Returns

JsonMarshaller

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