Skip to main content

MapEnumAttribute

Namespace: Riok.Mapperly.Abstractions

Customizes how enums are mapped.

public sealed class MapEnumAttribute : System.Attribute

Inheritance ObjectAttributeMapEnumAttribute

Properties

Strategy

The strategy to be used to map 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

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.