mapperly icon indicating copy to clipboard operation
mapperly copied to clipboard

Docs: explain how mapperly reuses user defined mappers

Open TimothyMakkison opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Docs don't mention how mapperly reuses user defined mappers. Could be its own section or added to User implemented mapping methods

[Mapper(EnumMappingStrategy = EnumMappingStrategy.ByName)]
public static partial class CarMapper
{
    [MapProperty(nameof(Car.Manufacturer), nameof(CarDto.Producer))] // Map property with a different name in the target type
    public static partial CarDto MapCarToDto(Car car);

    [MapperIgnoreSource("Make")]
    [MapperIgnoreTarget("Make")]
    private static partial TireDto MyMapToTireDto(Tire source);
}

TimothyMakkison avatar Jul 19 '23 09:07 TimothyMakkison

Also improve the documentation on which user defined or user implemented mapping is used by Mapperly (always the first one that matches the given types). Rel. https://github.com/riok/mapperly/discussions/1007#discussion-5963848

latonz avatar Dec 15 '23 12:12 latonz