Table of Contents

Class WebSocketActorDaprSerializer

Namespace
Virtufin.WebSocketManager.Actors
Assembly
Virtufin.WebSocketManager.dll
public sealed class WebSocketActorDaprSerializer : IDaprSerializer
Inheritance
WebSocketActorDaprSerializer
Implements
IDaprSerializer
Inherited Members

Methods

Deserialize(string?, Type)

Deserializes a string to an object of the specified type.

[RequiresUnreferencedCode("Runtime-type deserialization is not used by this actor.")]
[RequiresDynamicCode("Runtime-type deserialization is not used by this actor.")]
public object? Deserialize(string? data, Type returnType)

Parameters

data string

The string data to deserialize. Can be null or empty.

returnType Type

The target type to deserialize to.

Returns

object

The deserialized object, or null if data is null or empty.

Remarks

Prefer Deserialize<T>(string) when the type is known at compile time.

Exceptions

ArgumentNullException

Thrown if returnType is null.

Deserialize<T>(string?)

Deserializes a string to an object of the specified type.

public T? Deserialize<T>(string? data)

Parameters

data string

The string data to deserialize. Can be null or empty.

Returns

T

The deserialized object of type T, or default(T) if data is null or empty.

Type Parameters

T

The target type to deserialize to.

Serialize(object?, Type?)

Serializes an object to a string representation using an optional type hint.

[RequiresUnreferencedCode("Runtime-type serialization is not used by this actor.")]
[RequiresDynamicCode("Runtime-type serialization is not used by this actor.")]
public string Serialize(object? value, Type? inputType = null)

Parameters

value object

The object to serialize. Can be null.

inputType Type

Optional type hint for the object being serialized. Some serializers may use this for better type fidelity. If null, the serializer should use the runtime type of value.

Returns

string

A string representation of the object. Returns an empty string if value is null.

Remarks

Prefer Dapr.Common.Serialization.IDaprSerializer.Serialize<T>(T) when the type is known at compile time.

Serialize<T>(T)

Serializes a value of a known type to its string representation.

public string Serialize<T>(T value)

Parameters

value T

The value to serialize. Can be null.

Returns

string

A string representation of the value. Returns an empty string if value is null.

Type Parameters

T

The compile-time type of the value being serialized.