Table of Contents

Class DaprStateStoreEntryJsonConverter

Namespace
Virtufin.WebSocketManager.Services
Assembly
Virtufin.WebSocketManager.dll

Validates a deserialized DaprStateStoreEntry: throws InvalidOperationException if the persisted JSON is missing the required InstanceId field. This funnels data-integrity errors to the deserialization boundary, where the connection ID is still identifiable, instead of letting null-carrying entries reach business logic that wraps every usage with a guard.

public sealed class DaprStateStoreEntryJsonConverter : JsonConverter<DaprStateStoreEntry>
Inheritance
DaprStateStoreEntryJsonConverter
Inherited Members

Remarks

Reads the JSON manually rather than delegating to JsonSerializer.Deserialize<T>(ref Utf8JsonReader, JsonSerializerOptions): that call would re-invoke this same converter and stack-overflow.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type DaprStateStoreEntry.

public override DaprStateStoreEntry Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

DaprStateStoreEntry

The converted value.

Write(Utf8JsonWriter, DaprStateStoreEntry, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, DaprStateStoreEntry value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value DaprStateStoreEntry

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.