Created
November 15, 2012 09:28
-
-
Save bzbetty/4077624 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var child in source.ChildCollection) | |
{ | |
var targetChild = target.ChildCollection.SingleOrDefault(c => c.Equals(child)); //overwrite Equals or replace comparison with an Id comparison | |
if (targetChild == null) target.ChildCollection.Add(Mapper.Map<SourceChildType, TargetChildType>(child)); else Mapper.Map(child, targetChild); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment