Table of Contents

Class DocumentConverter<T>

Namespace
DataStax.AstraDB.DataApi.SerDes
Assembly
DataStax.AstraDB.DataApi.dll

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

T

The 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

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

T

Write(Utf8JsonWriter, T, JsonSerializerOptions)

Writes a T document instance as JSON.

public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value T
options JsonSerializerOptions