Class DocumentConverter<T>
A custom converter to handle converting documents to and from JSON using the DocumentMappingAttribute to handle DataAPI-specific properties.
public class DocumentConverter<T> : JsonConverter<T>
Type Parameters
TThe type of the document
- Inheritance
-
DocumentConverter<T>
- Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts JSON to a T document instance.
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReadertypeToConvertTypeoptionsJsonSerializerOptions
Returns
- T
Write(Utf8JsonWriter, T, JsonSerializerOptions)
Writes a T document instance as JSON.
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWritervalueToptionsJsonSerializerOptions