Table of Contents

Method DeserializeAsync

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

DeserializeAsync<TData>(MessageContent, CancellationToken)

Reads a message's value as TData.

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

Parameters

content MessageContent

The message.

cancellationToken CancellationToken

Cancels the registry call, if one is needed.

Returns

ValueTask<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.

DeserializeAsync(MessageContent, Type, CancellationToken)

Reads a message's value as dataType.

public virtual ValueTask<object?> DeserializeAsync(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

ValueTask<object>

Exceptions

FormatException

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

InvalidOperationException

dataType is not a type the serializer can read.