Skip to main content

Existing target object

If an existing object instance should be used as target, you can define the mapping method as void with the target as second parameter:

Mapper declaration
public partial class CarMapper
public partial void CarToCarDto(Car car, CarDto dto);
Mapper usage
var mapper = new CarMapper();
var car = new Car { NumberOfSeats = 10, ... };
var dto = new CarDto();

mapper.CarToCarDto(car, dto);