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(); }
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(); }