Constructor AvroSharpSerializer
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
clientISchemaRegistryClientThe schema registry.
configAvroSharpSerializerConfigThe settings, or null for the defaults.
ruleRegistryRuleRegistryThe data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.
Exceptions
- InvalidOperationException
Tis not registered in AvroTypes.- ArgumentException
confighas a key the serializer doesn't know, or enables bothuse.latest.versionandauto.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
clientISchemaRegistryClientThe schema registry.
typeAvroTypeInfo<T>The type's schema and serializers.
configAvroSharpSerializerConfigThe settings, or null for the defaults.
ruleRegistryRuleRegistryThe data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.
Exceptions
- ArgumentException
confighas a key the serializer doesn't know, or enables bothuse.latest.versionandauto.register.schemas(the default).