【发布时间】:2012-11-29 09:01:39
【问题描述】:
考虑:
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 价值
有没有办法在保持原始值的同时进行映射?
【问题讨论】:
-
你能展示你的创建地图配置吗?
标签: c# automapper dto