How to map specific property to entity model and child property to another entity model?
My DTO is:
public class InsertApplicationDTO
{
public ApplicationDetailsDTO ApplicationDetails { get; set; }
public int AuthorityNum { get; set; }
public string CertificateManager { get; set; }
public int? Area { get; set; }
public int? Team { get; set; }
}
I'd like to map the property ApplicationDetails to AppMirrorApplication
This is my profile:
public NYProfile()
{
CreateMap<AppMirrorApplication, InsertApplicationDTO>().ReverseMap()
.ForMember(x => x.ApplicationApproverTypeId, x => x.MapFrom(z => z.ApplicationDetails.ApplicationApproverTypeId))
.ForMember(x => x.ApplicationCategoryId, x => x.MapFrom(z => z.ApplicationDetails.ApplicationCategoryId));
}
This is working fine but i have a lot more property and i dont want to do it manually.
Also one of the Property in ApplicationDetailsDTO is object of type ClientDetailsDTO which i'd like to map it to AppMirrorClient
So the final result should be an entity called "AppMirrorApplication" which one of it property is type of AppMirrorClient.
Thank's