How to configure Conditional Mapping in AutoMapper?

Try this Mapper.CreateMap<Source, Target>() .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.

Automapper copy List to List

Once you’ve created the map (which you’ve already done, you don’t need to repeat for Lists), it’s as easy as: List<PersonView> personViews = Mapper.Map<List<Person>, List<PersonView>>(people); You can read more in the AutoMapper documentation for Lists and Arrays.