Class JsonPolymorphicWriteOnlyConverter<T>
JSON converter for converting inherited class types to JSON
Inherited Members
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
public class JsonPolymorphicWriteOnlyConverter<T> : JsonConverter<T> where T : ModelObject
Type Parameters
Name | Description |
---|---|
T |
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Read from JSON
Declaration
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | JSON reader |
Type | typeToConvert | Type to convert |
JsonSerializerOptions | options | Read options |
Returns
Type | Description |
---|---|
T | Read value |
Overrides
Write(Utf8JsonWriter, T, JsonSerializerOptions)
Write a CodeParameter to JSON
Declaration
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | JSON writer |
T | value | Value to serialize |
JsonSerializerOptions | options | Write options |