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
contentMessageContentThe message.
cancellationTokenCancellationTokenCancels the registry call, if one is needed.
Returns
- TData
Type Parameters
TDataThe type to read: a type AvroTypes knows, GenericRecord or AvroValue.
Exceptions
- FormatException
The content type is not
avro/binary+<schema ID>.- InvalidOperationException
TDatais 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
contentMessageContentThe message.
dataTypeTypeThe type to read: a type AvroTypes knows, GenericRecord or AvroValue.
cancellationTokenCancellationTokenCancels the registry call, if one is needed.
Returns
Exceptions
- FormatException
The content type is not
avro/binary+<schema ID>.- InvalidOperationException
dataTypeis not a type the serializer can read.