Is there a way to do this? We have a SummaryDto that maps from three different types, and when we create a map for each type, props that are not mapped are throwing an error. There are about 35 attributes on the summary dto. To use Ignore() option on each one is just too much trouble. Is there a global ignore? Something like
CreateMap<Source,Target>()
.IgnoreAllUnmapped();
This is working for me:
Because
ForAllMembersreturnsvoid, callingForAllMembers(o => o.Ignore())without this extension method wouldn’t work. We want to keep the mapping expression available to enable the subsequent mappings: