Closed leomeuk closed 8 years ago
Dear @leomeuk ,
Thanks a lot for your valuable input and using Expressmapper! You did great - except Expressmapper doesn't support destination nested mapping. I think no object-mapper supports it. I think the easiest way to implement registration is:
Mapper.Register<DTO, ViewModel>()
.Member(dest => dest.A, src => new Range{Start = src.StartA, End =src.EndA})
.Member(dest => dest.B, src => new Range{Start = src.StartB, End =src.EndB});
Please let me know what do you think and if you have any other concerns.
Thanks a lot!
I'm closing the issue. If you you have other concerns please reopen it. Thanks!
Consider some class with some nested objects,
where
Range
is defined as follows,Now suppose I want to map that from a simplified
DTO
class,If I were to register this mapping explicitly as per documentation I get somewhat unexpected results. Going from a fully populated
DTO
object to an initialisedViewModel
object, the second of theRange
objects will be copied correctly, the first will not.Is this behaviour to be expected?