Table of Contents

Constructor AvroSharpSerializer

Namespace
AvroSharp.Confluent
Assembly
AvroSharp.Confluent.dll

AvroSharpSerializer(ISchemaRegistryClient, AvroSharpSerializerConfig?, RuleRegistry?)

Creates a serializer of a generated type or a primitive, which AvroTypes knows. Generated types register themselves on .NET 5 and later; on .NET Standard, pass the type's AvroTypeInfo to the other constructor, or register it first.

public AvroSharpSerializer(ISchemaRegistryClient client, AvroSharpSerializerConfig? config = null, RuleRegistry? ruleRegistry = null)

Parameters

client ISchemaRegistryClient

The schema registry.

config AvroSharpSerializerConfig

The settings, or null for the defaults.

ruleRegistry RuleRegistry

The data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.

Exceptions

InvalidOperationException

T is not registered in AvroTypes.

ArgumentException

config has a key the serializer doesn't know, or enables both use.latest.version and auto.register.schemas (the default).

AvroSharpSerializer(ISchemaRegistryClient, AvroTypeInfo<T>, AvroSharpSerializerConfig?, RuleRegistry?)

Creates a serializer of the type that type reads and writes.

public AvroSharpSerializer(ISchemaRegistryClient client, AvroTypeInfo<T> type, AvroSharpSerializerConfig? config = null, RuleRegistry? ruleRegistry = null)

Parameters

client ISchemaRegistryClient

The schema registry.

type AvroTypeInfo<T>

The type's schema and serializers.

config AvroSharpSerializerConfig

The settings, or null for the defaults.

ruleRegistry RuleRegistry

The data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.

Exceptions

ArgumentException

config has a key the serializer doesn't know, or enables both use.latest.version and auto.register.schemas (the default).