public bool ProductInCategory(Product product, ProductCategory category)
 {
     if (product == null || category == null) { return false; }
     ProductCategory productCategory = product.ProductCategory;
     while (productCategory != null)
     {
         if (productCategory.Id == category.Id) { return true; }
         productCategory = productCategory.ParentCategory;
     }
     return false;
 }
 public void AddToCategory(Product product, ProductCategory category)
 {
     product.ProductCategory = category;
     category.CategoryMembers.Add(product);
 }