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

Custom JSON converter for handling serialization and deserialization of Dictionary<string, object?> using System.Text.Json. More...

Inheritance diagram for Buzzware.Cascade.DictionaryJsonConverter:

Public Member Functions

override Dictionary< string, object?> Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 Reads JSON data and converts it into a Dictionary<string, object?>.
override void Write (Utf8JsonWriter writer, Dictionary< string, object?> value, JsonSerializerOptions options)
 Writes a Dictionary<string, object?> to JSON format.

Detailed Description

Custom JSON converter for handling serialization and deserialization of Dictionary<string, object?> using System.Text.Json.

Member Function Documentation

◆ Read()

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

Reads JSON data and converts it into a Dictionary<string, object?>.

Parameters
readerThe reader that reads the JSON data.
typeToConvertThe type that is being converted (unused in this implementation).
optionsOptions for deserialization.
Returns
A Dictionary with key-value pairs obtained from the JSON data.

◆ Write()

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

Writes a Dictionary<string, object?> to JSON format.

Parameters
writerThe writer that writes the JSON data.
valueThe dictionary to be serialized.
optionsOptions for serialization.

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