private void FixupProductModel(ProductModel previousValue) { if (previousValue != null && previousValue.Products.Contains(this)) { previousValue.Products.Remove(this); } if (ProductModel != null) { if (!ProductModel.Products.Contains(this)) { ProductModel.Products.Add(this); } if (ProductModelID != ProductModel.ProductModelID) { ProductModelID = ProductModel.ProductModelID; } } else if (!_settingFK) { ProductModelID = null; } }
private void FixupProductModel(ProductModel previousValue) { if (previousValue != null && previousValue.ProductModelProductDescriptionCultures.Contains(this)) { previousValue.ProductModelProductDescriptionCultures.Remove(this); } if (ProductModel != null) { if (!ProductModel.ProductModelProductDescriptionCultures.Contains(this)) { ProductModel.ProductModelProductDescriptionCultures.Add(this); } if (ProductModelID != ProductModel.ProductModelID) { ProductModelID = ProductModel.ProductModelID; } } }