Consider :
class OriginalContact
{
public int Id{set;get;}
public string Name{set;get;}
public string CustomerCode{set;get;}
}
class DTOContact
{
public int Id{set;get;}
public string Name{set;get;}
}
OriginalContact originalContact = new OriginalContact
{
CustomerCode="123";
}
DTOContact dtoContact= new DTOContact
{
Id=1,
Name="David"
}
Mapper.Map(dtoContact, originalContact);
After this mapping i lose CustomerCode value
Is there any way to map while keeping original values ?
You should be able to ‘ignore’ the destination value in your create map configuration: