Class IdListConverter
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
readerUtf8JsonReadertypeToConvertTypeoptionsJsonSerializerOptions
Returns
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
writerUtf8JsonWritervalueList<object>optionsJsonSerializerOptions