예제 #1
0
 public IActionResult Delete(int id)
 {
     try
     {
         _deleteCommand.Execute(id);
         return(NoContent());
     }
     catch (EntityNotFoundException)
     {
         return(Conflict("Product ne postoji"));
     }
     catch (Exception)
     {
         return(StatusCode(500, "Doslo je do greske"));
     }
 }
        public IHttpActionResult DeleteProduct(int id)
        {
            var product = _IDeleteProductCommand.Execute(id);

            return(Ok(product));
        }
예제 #3
0
        public ActionResult Delete(int id)
        {
            deleteProductCommand.Execute(id);

            return(RedirectToAction("Index"));
        }