Table of Contents

Class WriteOnlyDocumentConverter

Namespace
JsonApiDotNetCore.Serialization.JsonConverters
Assembly
JsonApiDotNetCore.dll

Converts Document to JSON.

[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
public sealed class WriteOnlyDocumentConverter : JsonObjectConverter<Document>
Inheritance
WriteOnlyDocumentConverter
Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Always throws a NotSupportedException. This converter is write-only.

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

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

Document

Write(Utf8JsonWriter, Document, JsonSerializerOptions)

Conditionally writes

"data": null
or omits it, depending on IsAssigned.
public override void Write(Utf8JsonWriter writer, Document value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value Document
options JsonSerializerOptions