can automapper create an object graph from flatted object?

Is possible with Automapper to map a flat object to complex object graph?

 Mapper.CreateMap<PersonDto,Person>()

Map PersonDto.BirthCertificateFatherName to Person.BirthCertificate.FatherName


No it can't, it does it the other way

Person.BirthCertificate.FatherName to  PersonDto.BirthCertificateFatherName

UPDATE: ValueInjecter can do this:

//unflattening
person.InjectFrom<UnflatLoopValueInjection>(personDto);

//flatenning
personDto.InjectFrom<FlatLoopValueInjection>(person);
链接地址: http://www.djcxy.com/p/966.html

上一篇: 实体框架和多语言数据库

下一篇: 可以自动映射器从平铺对象创建对象图吗?