Class JsonGenericConverter<T>
Converts generic types for System.Text.Json based serialization.
Namespace: Neon.JsonConverters
Assembly: Neon.JsonConverters.dll
Syntax
public class JsonGenericConverter<T> : JsonConverter<T>
Type Parameters
| Name | Description |
|---|---|
| T | Converts generic types for based serialization. |
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type T.
Declaration
public override T Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | The reader. |
| Type | type | |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
| Type | Description |
|---|---|
| T | The converted value. |
Overrides
Write(Utf8JsonWriter, T, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | The writer to write to. |
| T | value | The value to convert to JSON. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |