2

How can I map the complex UploadDTO to the entity Number?

public class UploadDTO
{
    public CustomerDTO Customer { get; set; }
    public MachineDTO Machine { get; set; }
    public NumberDTO Number { get; set; }
}

public class Number
{
    public Customer Customer { get; set; }
    public Machine Machine { get; set; }
}

UPDATE

Mapper.CreateMap<CustomerDTO , Customer >();
 Mapper.CreateMap<MachineDTO , Machine >();
 Mapper.CreateMap<NumberDTO , Number>();

Problem is that the UploadDTO mapping is missing so it does not work. But how can I say:"take UploadDTO.Customer TO Customer for example?"

Pascal
  • 12,265
  • 25
  • 103
  • 195

1 Answers1

0

Just add the missing mapping from UploadDTO to Number:

Mapper.CreateMap<UploadDTO , Number>();
thepirat000
  • 12,362
  • 4
  • 46
  • 72