Suppose I have the following entities (classes)
public class Target { public string Value; } public class Source { public string Value1; public
Try this
Mapper.CreateMap() .ForMember(dest => dest.Value, opt => opt.MapFrom (src => src.Value1.StartsWith("A") ? src.Value1 : src.Value2));
Condition option is used to add conditions to properties that must be met before that property will be mapped and MapFrom option is used to perform custom source/destination member mappings.