I want to map 3 different classes into a single DTO, each property have the same name on the source and the destination, the classes are the following:
- User
- Candidate
- Portfolio
this is the DTO and how I want to map my objects:
public class CandidateTextInfo
{
public string ProfilePicture { get; set; } //-->User
public ObjectId UserId { get; set; } //-->User
public string Name { get; set; } //--> Candidate
public string Headline { get; set; } //--> Candidate
public Gender Gender { get; set; } //--> Candidate
public byte Rating { get; set; } //--> Candidate
public bool IsCompany { get; set; } //--> Candidate
public string[] Tags { get; set; } //--> Portafolio
public string[] Categories { get; set; } //--> Portafolio
public string ExecutiveSummary { get; set; } //--> Portafolio
public HourlyRate HourlyRate{ get; set; } //--> Candidate
}
I've been looking in SO and I found this solution but I don't get the method ConstructUsing
so how can I do to have a many to one mapping, is that possible, if not any workaround?