private void FixupProductPhoto(ProductPhoto previousValue) { if (previousValue != null && previousValue.ProductProductPhotoes.Contains(this)) { previousValue.ProductProductPhotoes.Remove(this); } if (ProductPhoto != null) { if (!ProductPhoto.ProductProductPhotoes.Contains(this)) { ProductPhoto.ProductProductPhotoes.Add(this); } if (ProductPhotoID != ProductPhoto.ProductPhotoID) { ProductPhotoID = ProductPhoto.ProductPhotoID; } } }