Table of Contents

Class EnumToNumberConverter<TEnum, TNumber>

Namespace
Microsoft.EntityFrameworkCore.Storage.ValueConversion
Assembly
Microsoft.EntityFrameworkCore.dll

Converts enum values to and from their underlying numeric representation.

public class EnumToNumberConverter<TEnum, TNumber> : ValueConverter<TEnum, TNumber> where TEnum : struct, Enum where TNumber : struct

Type Parameters

TEnum
TNumber
Inheritance
ValueConverter<TEnum, TNumber>
EnumToNumberConverter<TEnum, TNumber>
Inherited Members

Remarks

See EF Core value converters for more information and examples.

Constructors

EnumToNumberConverter()

Creates a new instance of this converter. This converter preserves order.

public EnumToNumberConverter()

Remarks

See EF Core value converters for more information and examples.

EnumToNumberConverter(ConverterMappingHints?)

Creates a new instance of this converter. This converter preserves order.

public EnumToNumberConverter(ConverterMappingHints? mappingHints)

Parameters

mappingHints ConverterMappingHints

Hints that can be used by the ITypeMappingSource to create data types with appropriate facets for the converted data.

Remarks

See EF Core value converters for more information and examples.

Properties

DefaultInfo

A ValueConverterInfo for the default use of this converter.

public static ValueConverterInfo DefaultInfo { get; }

Property Value

ValueConverterInfo