Exemplo n.º 1
0
 public void Associate()
 {
     foreach (EntityViewModel e in SelectedMasterEntities)
     {
         if (e.Id != this.Id && ChildEntityList.Where(c => c.Id == e.Id).Any() == false)
         {
             ChildEntityList.Add(e);
         }
     }
     SelectedMasterEntities.Clear();
 }
Exemplo n.º 2
0
 public void Disassociate()
 {
     foreach (EntityViewModel e in SelectedChildEntities)
     {
         EntityViewModel rem = ChildEntityList.Where(le => le.Id == e.Id).FirstOrDefault();
         if (rem != null)
         {
             RemovalPendingChildEntities.Add(rem);
             ChildEntityList.Remove(rem);
         }
     }
     SelectedChildEntities.Clear();
 }