Created
January 12, 2016 22:12
-
-
Save HakanL/e8c293c5b80193e622f7 to your computer and use it in GitHub Desktop.
Example of how to use the ListMergerUtils.cs
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
// Map answers | |
Util.MapImmutableOneToMany( | |
currentData: target.Answer, | |
newData: source.Answers, | |
equality: (a, b) => a.ExternalId == b.AnswerId, | |
insert: i => | |
{ | |
var newEntity = new DataModel.Answer(); | |
TransformAnswer(newEntity, i); | |
target.Answer.Add(newEntity); | |
}, | |
delete: d => d.Deleted = DateTime.Now, | |
update: (t, s) => TransformAnswer(t, s) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment