Riok.Mapperly by Mapperly Contributors, Lars Tönz, Manuel Allenspach

<PackageReference Include="Riok.Mapperly" Version="3.3.0-next.6" />

 MapDerivedTypeAttribute

public sealed class MapDerivedTypeAttribute : Attribute
Specifies derived type mappings for which a mapping should be generated. A type switch is implemented over the source object and the provided source types. Each source type has to be unique but multiple source types can be mapped to the same target type. Each source type needs to extend or implement the parameter type of the mapping method. Each target type needs to extend or implement the return type of the mapping method.
public Type SourceType { get; }

Gets the source type of the derived type mapping.

public Type TargetType { get; }

Gets the target type of the derived type mapping.

public MapDerivedTypeAttribute(Type sourceType, Type targetType)

Registers a derived type mapping.