Class AvroTypes
- Namespace
- AvroSharp.Serialization
- Assembly
- AvroSharp.dll
Finds a type's AvroTypeInfo<T> without reflection, so generic code and code that has only a
Type can read and write it on every target and under Native AOT. Generated types register
themselves from their assembly's module initializer, which runs when code of the assembly first runs, or when one
of its types is looked up here (on targets with module initializers, .NET 5 and later; elsewhere call
Register<T>(AvroTypeInfo<T>) with the type's AvroTypeInfo). bool, int,
long, float, double, string and
byte[] are registered with their primitive schemas.
public static class AvroTypes
- Inheritance
-
AvroTypes
- Inherited Members
Methods
- Get<T>()
Gets a type's registration.
- Register<T>(AvroTypeInfo<T>)
Registers a type; generated code calls it. A type registered again keeps its first registration.
- TryGet(Type, out AvroTypeInfo?)
Gets the registration of
type, if it has one.
- TryGet<T>(out AvroTypeInfo<T>?)
Gets a type's registration, if it has one.