1
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值
有什麼辦法,同時保持原有的值映射?
你能告訴您的創建地圖的配置? –