Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.ImmutableDictionaryJsonConverter Class Reference

Custom JSON converter for serializing and deserializing ImmutableDictionary<string, object?> using System.Text.Json. More...

Inheritance diagram for Buzzware.Cascade.ImmutableDictionaryJsonConverter:

Public Member Functions

override ImmutableDictionary< string, object?> Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 Reads and converts JSON to an ImmutableDictionary<string, object?>. Handles different token types and ensures proper deserialization.
override void Write (Utf8JsonWriter writer, ImmutableDictionary< string, object?> value, JsonSerializerOptions options)
 Writes the specified ImmutableDictionary<string, object?> to JSON. Iterates over key-value pairs to handle serialization.

Detailed Description

Custom JSON converter for serializing and deserializing ImmutableDictionary<string, object?> using System.Text.Json.

Member Function Documentation

◆ Read()

override ImmutableDictionary< string, object?> Buzzware.Cascade.ImmutableDictionaryJsonConverter.Read ( ref Utf8JsonReader reader,
Type typeToConvert,
JsonSerializerOptions options )
inline

Reads and converts JSON to an ImmutableDictionary<string, object?>. Handles different token types and ensures proper deserialization.

Parameters
readerThe reference to the JSON reader.
typeToConvertThe type of object to convert, used for validation.
optionsSerializer options for custom conversions.
Returns
Deserialized dictionary from JSON.

◆ Write()

override void Buzzware.Cascade.ImmutableDictionaryJsonConverter.Write ( Utf8JsonWriter writer,
ImmutableDictionary< string, object?> value,
JsonSerializerOptions options )
inline

Writes the specified ImmutableDictionary<string, object?> to JSON. Iterates over key-value pairs to handle serialization.

Parameters
writerJSON writer to output the JSON.
valueThe dictionary value to serialize.
optionsSerializer options for custom conversions.

The documentation for this class was generated from the following file:
  • Buzzware.Cascade/utilities/ImmutableDictionaryJsonConverter.cs