Skip to content

OrleansJsonSerializer Methods

Serializes and deserializes values using Newtonsoft.Json settings configured for Orleans types.

Deserialize(Type, Stream)

View source
public object? Deserialize(Type expectedType, Stream input)
Deserializes an object of the specified expected type from the provided stream.

Parameters

expectedTypeType
The expected type.
inputStream
The input stream.

Returns

The deserialized object.

Deserialize(Type, string?)

View source
public object? Deserialize(Type expectedType, string? input)
Deserializes an object of the specified expected type from the provided input.

Parameters

expectedTypeType
The expected type.
inputstring?
The input.

Returns

The deserialized object.

Serialize(object?, Type)

View source
public string Serialize(object? item, Type expectedType)
Serializes an object to a JSON string.

Parameters

itemobject?
The object to serialize.
expectedTypeType
The type the deserializer should expect.

Returns

The JSON representation of item.

Serialize(object?, Type, Stream)

View source
public void Serialize(object? item, Type expectedType, Stream destination)
Serializes an object to a stream.

Parameters

itemobject?
The object to serialize.
expectedTypeType
The type the deserializer should expect.
destinationStream
The destination stream.