Esempio n. 1
0
 public void Create(Product product)
 {
     if (product != null)
     {
         Context.Products.Add(product);
     }
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 public void VerifyProduct(Product product)
 {
     product.Verified = true;
 }
Esempio n. 4
0
 public void AddToCategory(Product product, ProductCategory category)
 {
     product.ProductCategory = category;
     category.CategoryMembers.Add(product);
 }
Esempio n. 5
0
 public void Update(Product product)
 {
     Context.Entry(product).State = EntityState.Modified;
 }