Method FromEnum
FromEnum(EnumSchema, int)
Creates an enum value from its ordinal.
public static AvroValue FromEnum(EnumSchema schema, int ordinal)
Parameters
schemaEnumSchemaThe enum schema.
ordinalintThe zero-based ordinal of the symbol.
Returns
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
schemaEnumSchemaThe enum schema.
symbolstringThe symbol (case-sensitive).
Returns
Exceptions
- ArgumentException
The symbol is not defined by the enum.