Mapping:
.ForMember(dest => dest.DisplayName, opt => { opt.PreCondition(location => location.Parent != null); opt.MapFrom(src => src.Name + ", " + src.Parent.Name); }) .ForMember(dest => dest.DisplayName, opt => { opt.PreCondition((src, dest, context) => dest.DisplayName == null); opt.MapFrom(src => src.Name); }) Expected result:
If the first condition is met don't override the mapping.
What actually happens:
The second mapping is overriding the first mapping.
How can I solve this?