考虑 :
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);
在这个映射之后,我失去了CustomerCode值
有没有办法在保持原始值的同时进行映射?