BuildExpression method

Builds a duration serializer for a type-schema pair.
Signature
public override Chr.Avro.Serialization.IBinarySerializerBuildResult BuildExpression (System.Linq.Expressions.Expression value, Chr.Avro.Resolution.TypeResolution resolution, Chr.Avro.Abstract.Schema schema, Chr.Avro.Serialization.IBinarySerializerBuilderContext context);

Parameters

Expression value
An expression that represents the value to be serialized.
TypeResolution resolution
The resolution to obtain type information from.
Schema schema
The schema to map to the type.
IBinarySerializerBuilderContext context
Information describing top-level expressions.

Return type

IBinarySerializerBuildResult
A successful result if the resolution is a DurationResolution and the schema’s logical type is a DurationLogicalType; an unsuccessful result otherwise.

Exceptions

UnsupportedSchemaException
Thrown when the schema is not a FixedSchema with size 12 and logical type DurationLogicalType.
UnsupportedTypeException
Thrown when the resolved type cannot be converted to TimeSpan.
Chr.Avro