I'm trying to map 2 objects of the same type.
What I want to do is AutoMapper to igonore all the properties, that have Null
value in the source object, and keep the existing value in the destination object.
I've tried using this in my "Repository", but it doesn't seem to work.
Mapper.CreateMap<TEntity, TEntity>().ForAllMembers(p => p.Condition(c => !c.IsSourceValueNull));
What might be the problem ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…