I have a couple of objects in a project which is currently using AutoMapper 10 where the I need one particular property to be mapped before all the others. In AM10 this was easy by setting the target properties mapping order to some low value, then everything else to a higher one using ForAllOtherMembers
:
cfg.CreateMap<Source, Dest>()
.ForMember(d => d.MapMeFirst, opt => opt.SetMappingOrder(int.MinValue))
.ForAllOtherMembers(c => c.SetMappingOrder(0));
);
But with AM11, ForAllOtherMembers
has been removed. No matter what I set the mapping order of MapMeFirst
to, it makes no difference unless I also set the mapping order for every other property, which now has to be done explicitly without ForAllOtherMembers
.
Is there anyway of achieving this another way?