Skip to main content

Static mappers and extension methods

Mapperly supports static mappers and extension methods:

[Mapper]
public static partial class CarMapper
{
public static partial CarDto CarToCarDto(this Car car);

private static int TimeSpanToHours(TimeSpan t) => t.Hours;
}
info

Mapperly does not support static partial mapping methods in non-static mapper classes.