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)); }
public ActionResult Delete(int id) { deleteProductCommand.Execute(id); return(RedirectToAction("Index")); }