public void RemoveChildGroup(UserGroup group) { if (!children.Contains(group)) { throw new InvalidOperationException("The user group is not a child of this parent"); } children.Remove(group); group.Parent = null; }
public void AddChildGroup(UserGroup group) { if (children.Contains(group)) { throw new InvalidOperationException("The user group already belongs to this parent"); } children.Add(group); group.Parent = this; }