Exemple #1
0
 public IActionResult UpdateProduct(Product product)
 {
     if (product.Id == 0)
     {
         _dataService.AddProduct(product);
     }
     else
     {
         _dataService.UpdateProduct(product);
     }
     return(RedirectToAction(nameof(Index)));
 }