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
setupAction<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
setupAction<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
dataStreamThe string from which to deserialize the object graph.
returnTypeTypeThe 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
dataStreamThe object from which to deserialize the object graph.
Returns
- TValue
An object of
TValue.
Type Parameters
TValueThe 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
valueobjectThe object to serialize to Stream format.
inputTypeTypeThe type of the object to serialize.
Returns
Serialize<TValue>(TValue)
Serializes the specified value to an object of Stream.
public Stream Serialize<TValue>(TValue value)
Parameters
valueTValueThe object to serialize to Stream format.
Returns
Type Parameters
TValue