Table of Contents

Method Serialize

Namespace
AvroSharp.Confluent
Assembly
AvroSharp.Confluent.dll

Serialize(T, SerializationContext)

Writes a value without a task once the topic's schema ID is known; until then, and with settings whose rules can run asynchronously, it waits for SerializeAsync(T, SerializationContext).

[SuppressMessage("Usage", "VSTHRD002:Avoid problematic synchronous waits", Justification = "Confluent.Kafka's synchronous interface: it waits only until the topic's schema ID is known, or with settings whose rules can run asynchronously.")]
public byte[]? Serialize(T data, SerializationContext context)

Parameters

data T

The value. A null reference is written as no message body.

context SerializationContext

The topic, the component (key or value) and the headers.

Returns

byte[]

The message body, or null for a tombstone.