Table of Contents

Class IdListConverter

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

A custom converter to handle serialization and deserialization of a list of IDs

public class IdListConverter : JsonConverter<List<object>>
Inheritance
IdListConverter
Inherited Members

Remarks

We recommend using strongly-typed IDs instead of objects.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts JSON to a List<T> of document identifiers.

public override List<object> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

List<object>

Write(Utf8JsonWriter, List<object>, JsonSerializerOptions)

Writes a list of document identifiers as a JSON array.

public override void Write(Utf8JsonWriter writer, List<object> value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value List<object>
options JsonSerializerOptions