private void FixupProductSubcategory(ProductSubcategory previousValue) { if (previousValue != null && previousValue.Products.Contains(this)) { previousValue.Products.Remove(this); } if (ProductSubcategory != null) { if (!ProductSubcategory.Products.Contains(this)) { ProductSubcategory.Products.Add(this); } if (ProductSubcategoryID != ProductSubcategory.ProductSubcategoryID) { ProductSubcategoryID = ProductSubcategory.ProductSubcategoryID; } } else if (!_settingFK) { ProductSubcategoryID = null; } }
private void FixupProductSubcategory(ProductSubcategory previousValue) { if (previousValue != null && previousValue.Products.Contains(this)) { previousValue.Products.Remove(this); } if (ProductSubcategory != null) { if (!ProductSubcategory.Products.Contains(this)) { ProductSubcategory.Products.Add(this); } if (ProductSubcategoryID != ProductSubcategory.ProductSubcategoryID) { ProductSubcategoryID = ProductSubcategory.ProductSubcategoryID; } } else if (!_settingFK) { ProductSubcategoryID = null; } }