Namespace: Json.More
Inheritance: EnumStringConverter<T>
🡒 WeaklyTypedJsonConverter<T>
🡒 JsonConverter<T>
🡒 JsonConverter
🡒 object
Implemented interfaces:
- IWeaklyTypedJsonConverter
Properties
Name | Type | Summary |
---|---|---|
HandleNull | bool | |
Type | Type |
Methods
Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads and converts the JSON to type
Declaration
1
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameter | Type | Description |
---|---|---|
reader | ref Utf8JsonReader | The reader. |
typeToConvert | Type | The type to convert. |
options | JsonSerializerOptions | An object that specifies serialization options to use. |
Returns
The converted value.
ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads a dictionary key from a JSON property name.
Declaration
1
public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameter | Type | Description |
---|---|---|
reader | ref Utf8JsonReader | The System.Text.Json.Utf8JsonReader to read from. |
typeToConvert | Type | The type to convert. |
options | JsonSerializerOptions | The options to use when reading the value. |
Returns
The value that was converted.
Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Writes a specified value as JSON.
Declaration
1
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameter | Type | Description |
---|---|---|
writer | Utf8JsonWriter | The writer to write to. |
value | T | The value to convert to JSON. |
options | JsonSerializerOptions | An object that specifies serialization options to use. |
WriteAsPropertyName(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Writes a dictionary key as a JSON property name.
Declaration
1
public override void WriteAsPropertyName(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameter | Type | Description |
---|---|---|
writer | Utf8JsonWriter | The System.Text.Json.Utf8JsonWriter to write to. |
value | T | The value to convert. The value of System.Text.Json.Serialization.JsonConverter`1.HandleNull determines if the converter handles <see langword=”null” /> values. |
options | JsonSerializerOptions | The options to use when writing the value. |