API reference

The public API of the AvroSharp packages, generated from the XML documentation in the source.

Namespace What it holds
AvroSharp The exceptions: AvroException, AvroDataException for malformed data, AvroSchemaException for invalid schemas
AvroSharp.Schemas The schema model and parser, Parsing Canonical Form, fingerprints, logical types
AvroSharp.IO AvroWriter and AvroReader: the binary encoding over spans, buffer writers and sequences
AvroSharp.Generic AvroValue, GenericRecord, and the generic binary and JSON readers and writers, with schema resolution
AvroSharp.Containers Object container files, sync and async, with seeking and pipelined reading; AvroCodec, DeflateCodec, and AvroCodecNames, the codec names of the specification
AvroSharp.Codecs The snappy, zstandard, bzip2 and xz codecs (the AvroSharp.Codecs package)
AvroSharp.Messages Single-object encoding and schema-registry framing, with the schema resolvers and their in-memory stores
AvroSharp.Streams Streams of objects without a container
AvroSharp.Serialization AvroSerializer, the interfaces generated types implement, the logical-value conversions, and the read and write delegates
AvroSharp.Serialization.Generated The support that generated code calls; not for direct use (see the compatibility policy in the design notes). It has no page in this reference
AvroSharp.CodeGen The C# code generation engine (the AvroSharp.CodeGen package)
AvroSharp.Confluent Confluent Schema Registry serializers and deserializers for Confluent.Kafka (the AvroSharp.Confluent package; see its guide)
AvroSharp.KafkaFlow KafkaFlow serializer middleware on AvroSharp.Confluent (the AvroSharp.KafkaFlow package; see its guide)
AvroSharp.Azure.SchemaRegistry An Azure Schema Registry serializer for Event Hubs and Service Bus messages (the AvroSharp.Azure.SchemaRegistry package; see its guide)
AvroSharp.Aws.Glue A managed AWS Glue Schema Registry serializer (the AvroSharp.Aws.Glue package; see its guide)
AvroSharp.Aws.Glue.Kafka Confluent.Kafka serializers on it (the AvroSharp.Aws.Glue.Kafka package)

Where to start

.NET 8 and later only

The reference is built from the net10.0 build, so it shows every member. These need .NET 8 or later, because they rely on static abstract interface members; on .NET Standard and .NET Framework, the overloads that take a schema and the generated Write/Read delegates do the same:

Member On every target
IAvroSerializable<TSelf>, which generated types implement with C# 11 or later the generated static Schema, Write and Read
AvroSerializer.Serialize<T>, TrySerialize<T>, Deserialize<T> value.ToAvroBytes(), T.FromAvroBytes(bytes)
AvroFileWriter.Create<T>(stream), AvroFileReader.Open<T>(stream), OpenAsync<T>(stream) AvroFileWriter.Create<T>(stream, T.Schema, T.Write), AvroFileReader.Open<T>(stream, _ => T.Read)
AvroStreamWriter.Create<T>(stream), AvroStreamReader.Open<T>(stream) the overloads with T.Write and T.Read
AvroMessage.ToArray<T>/Write<T>, AvroMessageReader.Create<T> the overloads with the schema and T.Write, or a createReader delegate
AvroRegistryMessage.ToArray<T>/Write<T>, AvroRegistryMessageReader.Create<T> the overloads with T.Write, or a createReader delegate