Table of Contents

Method FromEnum

Namespace
AvroSharp.Generic
Assembly
AvroSharp.dll

FromEnum(EnumSchema, int)

Creates an enum value from its ordinal.

public static AvroValue FromEnum(EnumSchema schema, int ordinal)

Parameters

schema EnumSchema

The enum schema.

ordinal int

The zero-based ordinal of the symbol.

Returns

AvroValue

Exceptions

ArgumentOutOfRangeException

The ordinal is not a symbol of the enum.

FromEnum(EnumSchema, string)

Creates an enum value from its symbol.

public static AvroValue FromEnum(EnumSchema schema, string symbol)

Parameters

schema EnumSchema

The enum schema.

symbol string

The symbol (case-sensitive).

Returns

AvroValue

Exceptions

ArgumentException

The symbol is not defined by the enum.