public async Task<int> SaveProductAsync(Product product)
 {
     if (product.Id == 0)
     {
         context.Products.Add(product);
     }
     else {
         Product dbEntry = context.Products.Find(product.Id);
         if (dbEntry != null)
         {
             dbEntry.Name = product.Name;
             dbEntry.Description = product.Description;
             dbEntry.Price = product.Price;
             dbEntry.Category = product.Category;
         }
     }
     return await context.SaveChangesAsync();
 }
 public async Task PostProduct(Product product)
 {
     await Repository.SaveProductAsync(product);
 }
 public async Task<ActionResult> SaveProduct(Product product)
 {
     await repo.SaveProductAsync(product);
     return RedirectToAction("Index");
 }