Table of Contents

Class DatasetIdJsonConverter

Namespace
EncDotNet.S100.Datasets.Pipelines.Catalog
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

Serialises DatasetId as a bare JSON string so that the identifier round-trips symmetrically: every tool accepts a plain string datasetId argument, and every tool result therefore emits the same plain string rather than a wrapped {"value":"…"} object.

public sealed class DatasetIdJsonConverter : JsonConverter<DatasetId>
Inheritance
DatasetIdJsonConverter
Inherited Members

Remarks

On read the converter is lenient — it accepts either a bare string (the canonical form) or the legacy {"value":"…"} object — so that any caller or persisted payload using the older wrapped shape continues to bind. On write it always emits the bare string.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type DatasetId.

public override DatasetId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

DatasetId

The converted value.

ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads a dictionary key from a JSON property name.

public override DatasetId ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The Utf8JsonReader to read from.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

The options to use when reading the value.

Returns

DatasetId

The value that was converted.

Write(Utf8JsonWriter, DatasetId, JsonSerializerOptions)

Writes a specified value as JSON.

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

Parameters

writer Utf8JsonWriter

The writer to write to.

value DatasetId

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.

WriteAsPropertyName(Utf8JsonWriter, DatasetId, JsonSerializerOptions)

Writes a dictionary key as a JSON property name.

public override void WriteAsPropertyName(Utf8JsonWriter writer, DatasetId value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The Utf8JsonWriter to write to.

value DatasetId

The value to convert. The value of HandleNull determines if the converter handles null values.

options JsonSerializerOptions

The options to use when writing the value.