using System.Collections.Generic;
public static void Main()
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<OrderLineDto, OrderLine>().ReverseMap();
IMapper mapper = new Mapper(config);
var dto = new OrderLineDto()
OriginalPalletBarcode = "caca",
Barcodes = new List<string>(){ "123456","7890"
var order=mapper.Map<OrderLineDto, OrderLine>(dto);
Assert.AreEqual(dto.OrderId,order.OrderId);
Console.WriteLine("dto id: {"+dto.OrderId+"} order Id : {"+order.OrderId+"}");
public class OrderLineDto
public int OrderId{ get; set; }
public string OriginalPalletBarcode { get; set; }
public List<string> Barcodes { get; set; }
public string Destination { get; set; }
public string Type { get; set; }
public bool IsMixable { get; set; }
public int Quantity { get; set; }
public int OrderId { get; set; }
public string OriginalPalletBarcode { get; set; }
public string BarcodesFlattened
public string Destination { get; set; }