开发者

can automapper create an object graph from flatted object?

Is possible with Automapper to m开发者_运维知识库ap 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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜