Class KeyOrderedDictionaryConverter<TKey, TValue>
JsonConverter for Dictionary with a simple key: the key is read and written by the converter of its type, as
System.Text.Json does without a converter; a read lists the entries by key.
public class KeyOrderedDictionaryConverter<TKey, TValue> : JsonConverter<Dictionary<TKey, TValue>> where TKey : notnull
Inheritance
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type .
public override Dictionary<TKey, TValue>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Write(Utf8JsonWriter, Dictionary<TKey, TValue>?, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, Dictionary<TKey, TValue>? value, JsonSerializerOptions options)