public void UnlinkSubOrg(Organization subOrg) { subOrg.RemoveParentId(); if (SubOrgs != null) { SubOrgs.Remove(subOrg); } }
public void AddSubOrg(Organization subOrg) { //check to make sure that the org doesn't already exist in the list and add here subOrg.SetParentId(this.ID); if (SubOrgs == null) { SubOrgs = new List <Organization> { subOrg } } ; else if (!SubOrgs.Select(x => x.ID).ToList().Contains(subOrg.ID)) { SubOrgs.Add(subOrg); } }