I am trying to use automapper to create a single map for a parent object and to reuse this amongst its children.
For child properties I only want to map the extra fields.
Is this possible? The code I have looks like this
CreateCalculationMap(message); ---- This does the BASE parent mappping.
Mapper.CreateMap<QuoteMessage, CalculationGipMessage>() -- This is the child.
.Include<QuoteMessage, CalculationBase>() -- Include the parent?
.ForMember(a => a.OngoingCommission, b => b.MapFrom(c => c.OngoingASF)) - Child
.ForMember(a => a.SpecialRate, b => b.MapFrom(c => c.BlahBlah))); - Child
Why does it keep telling me the parents properties are not mapped? Yet, I thought I included them in CreateCalculationMap(message); which contains
Mapper.CreateMap<QuoteMessage, CalculationBase>() ()
FYI I figured this out