7
Automapper를 사용하면 플랫 개체를 복잡한 개체 그래프에 매핑 할 수 있습니까? Person.BirthCertificate.FatherName자동화 된 객체는 평면 객체에서 객체 그래프를 만들 수 있습니까?
Automapper를 사용하면 플랫 개체를 복잡한 개체 그래프에 매핑 할 수 있습니까? Person.BirthCertificate.FatherName자동화 된 객체는 평면 객체에서 객체 그래프를 만들 수 있습니까?
에
Mapper.CreateMap<PersonDto,Person>()
지도 PersonDto.BirthCertificateFatherName 없음은 할 수 없습니다, 그것은 그것을 다른 방법을 수행
Person.BirthCertificate.FatherName to PersonDto.BirthCertificateFatherName
UPDATE : ValueInjecter는이 작업을 수행 할 수 있습니다
를//unflattening
person.InjectFrom<UnflatLoopValueInjection>(personDto);
//flatenning
personDto.InjectFrom<FlatLoopValueInjection>(person);
이 작업은 valueinject 어 http://valueinjecter.codeplex.com/ – Omu