Skip to content

Instantly share code, notes, and snippets.

@HakanL
Created January 12, 2016 22:12
Show Gist options
  • Save HakanL/e8c293c5b80193e622f7 to your computer and use it in GitHub Desktop.
Save HakanL/e8c293c5b80193e622f7 to your computer and use it in GitHub Desktop.
Example of how to use the ListMergerUtils.cs
// 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