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
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn 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
writerUtf8JsonWriterThe writer to write to.
valueDaprStateStoreEntryThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.