Skip to main content

MapEnumAttribute

Namespace: Riok.Mapperly.Abstractions

Customizes how enums are mapped.

public sealed class MapEnumAttribute : System.Attribute

Inheritance ObjectAttributeMapEnumAttribute
Attributes NullableContextAttribute, NullableAttribute, AttributeUsageAttribute, ConditionalAttribute

Properties

Strategy

The strategy to be used to map enums to enums.

public EnumMappingStrategy Strategy { get; }

Property Value

EnumMappingStrategy

IgnoreCase

Whether the case should be ignored during mappings.

public bool IgnoreCase { get; set; }

Property Value

Boolean

FallbackValue

The fallback value if an enum cannot be mapped, used instead of throwing.

public object FallbackValue { get; set; }

Property Value

Object

NamingStrategy

The strategy to be used to map enums from/to strings.

public EnumNamingStrategy NamingStrategy { get; set; }

Property Value

EnumNamingStrategy

TypeId

public object TypeId { get; }

Property Value

Object

Constructors

MapEnumAttribute(EnumMappingStrategy)

Customizes how enums are mapped.

public MapEnumAttribute(EnumMappingStrategy strategy)

Parameters

strategy EnumMappingStrategy
The strategy to be used to map enums.