Exemplo n.º 1
0
 public async Task Execute()
 {
     //process adds
     if (Add != null)
     {
         foreach (var e in Changed)
         {
             if (!Existing.Any(y => Compare(y, e)))
             {
                 await Add(e);
             }
         }
     }
     foreach (var e in Existing)
     {
         if (Changed.Any(x => Compare(e, x)))
         {
             if (Update != null)
             {
                 await Update(e, Changed.Single(x => Compare(e, x)));
             }
         }
         else
         {
             if (Remove != null)
             {
                 await Remove(e);
             }
         }
     }
 }