Table of Contents

Class WriteOnlyRelationshipObjectConverter

Namespace
JsonApiDotNetCore.Serialization.JsonConverters
Assembly
JsonApiDotNetCore.dll

Converts RelationshipObject to JSON.

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

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

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

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

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

RelationshipObject

Write(Utf8JsonWriter, RelationshipObject, JsonSerializerOptions)

Conditionally writes

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

Parameters

writer Utf8JsonWriter
value RelationshipObject
options JsonSerializerOptions