private void FixupProductGroup(ProductGroup previousValue) { if (previousValue != null && previousValue.Products.Contains(this)) { previousValue.Products.Remove(this); } if (ProductGroup != null) { if (!ProductGroup.Products.Contains(this)) { ProductGroup.Products.Add(this); } if (ProductGroupId != ProductGroup.Id) { ProductGroupId = ProductGroup.Id; } } }
private void FixupParentGroup(ProductGroup previousValue) { if (previousValue != null && previousValue.Children.Contains(this)) { previousValue.Children.Remove(this); } if (ParentGroup != null) { if (!ParentGroup.Children.Contains(this)) { ParentGroup.Children.Add(this); } if (ProductGroupId != ParentGroup.Id) { ProductGroupId = ParentGroup.Id; } } }