2
Vote

IgnoreMembers does not "ignore" the target member

description

I have a target class that I want to map some values from the source class. In both classes there is a property "Items". In the source class, Items is null. In the target class, Items has a value. I want to map from the source to the target but I don't want the source to overwrite Items on the target. I assumed I would be able to use "IgnoreMembers" in order to ignore this property (i.e. have EmitMapper completely skip this property during the mapping). Unfortunately EmitMapper treats "IgnoreMember" as though it were called "SetTargetToNullOrDefault".
 
IgnoreMembers should actually ignore the specified members on the target, not overwrite them with nulls (or defaults).

comments