Table of Contents

Method Deserialize

Namespace
AvroSharp.Azure.SchemaRegistry
Assembly
AvroSharp.Azure.SchemaRegistry.dll

Deserialize<TData>(MessageContent, CancellationToken)

Reads a message's value as TData.

public virtual TData Deserialize<TData>(MessageContent content, CancellationToken cancellationToken = default)

Parameters

content MessageContent

The message.

cancellationToken CancellationToken

Cancels the registry call, if one is needed.

Returns

TData

Type Parameters

TData

The type to read: a type AvroTypes knows, GenericRecord or AvroValue.

Exceptions

FormatException

The content type is not avro/binary+<schema ID>.

InvalidOperationException

TData is not a type the serializer can read.

Deserialize(MessageContent, Type, CancellationToken)

Reads a message's value as dataType.

public virtual object? Deserialize(MessageContent content, Type dataType, CancellationToken cancellationToken = default)

Parameters

content MessageContent

The message.

dataType Type

The type to read: a type AvroTypes knows, GenericRecord or AvroValue.

cancellationToken CancellationToken

Cancels the registry call, if one is needed.

Returns

object

Exceptions

FormatException

The content type is not avro/binary+<schema ID>.

InvalidOperationException

dataType is not a type the serializer can read.