I tried the following map:
CreateMap<ThemeNewModel, CreateThemeOrder.ThemeModel>()
.ForMember(d => d.Subject.Id, o => o.MapFrom(s => s.Subject));
Both Subject.Id and Subject are of type int. However, I get the following error:
Expression 'd => Convert(d.Subject.Id)' must resolve to top-level member and not any child object's properties. Use a custom resolver on the child type or the AfterMap option instead.Parameter name: lambdaExpression
I am using AutoMapper 2.0. Can't I solve this without AfterMap?