public ActionResult Delete(int id) { try { _deleteCategory.Execute(id); return(NoContent()); } catch (Exception) { return(StatusCode(500)); } }
public IActionResult Delete(int id) { try { _deleteCategory.Execute(id); return(StatusCode(204)); } catch (NotFoundException) { return(NotFound()); } }
// GET: Category/Delete/5 public IActionResult Delete(int id) { try { _deleteCategory.Execute(id); return(RedirectToAction(nameof(Index))); } catch (Exception) { return(RedirectToAction("index")); } }
// GET: User/Delete/5 public ActionResult Delete(int id) { try { _deleteCategory.Execute(id); return(RedirectToAction(nameof(Index))); } catch (Exception) { TempData["error"] = "Some error occurred. Please try again."; return(RedirectToAction(nameof(Index))); } }
public ActionResult <IEnumerable <CategoryDTO> > Delete(CategoryDTO dto) { try { _deleteCommand.Execute(dto); return(NoContent()); } catch (EntityNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }
public ActionResult Delete(int id, CategoryDto dto) { try { _deleteCommand.Execute(id); return(RedirectToAction(nameof(Index))); } catch (EntityDeleted) { TempData["error"] = "This category is already deleted"; return(View()); } catch (Exception) { return(View()); } }
public ActionResult Delete(int id) { try { deleteCategoryCommand.Execute(id); return(NoContent()); } catch (DataNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }
public ActionResult Delete(int id) { try { _deleteCategoryCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public IActionResult Delete(int id) { try { _deleteCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException) { return(NotFound("Ne psotoji objekat")); } catch (Exception) { return(StatusCode(500, "Doslo je do greske")); } }
public ActionResult Delete(int id, CategoryDTO category) { try { _deleteCategoryCommand.Execute(category); return(RedirectToAction(nameof(Index))); } catch (EntityNotFoundException) { return(View()); } catch (Exception) { return(RedirectToAction("index")); } }
// GET: Categories/Delete/5 public ActionResult Delete(int id) { try { deleteCategoryCommand.Execute(id); return(RedirectToAction("Index")); } catch (DataNotFoundException) { return(null); } catch (Exception) { return(RedirectToAction("Create")); } }
public ActionResult Delete(int id) { try { _deleteCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception) { return(StatusCode(500, "Server error has occurred.")); } }
public IActionResult Delete(int id) { try { _deleteCategoryCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { if (e.Message == "Category doesn't exist.") { return(NotFound(e.Message)); } return(UnprocessableEntity(e.Message)); } }
public ActionResult Delete(int id) { try { _deleteCategoryCommand.Execute(id); TempData["success"] = "Category deleted."; } catch (EntityNotFoundException e) { TempData["error"] = e.Message; } catch (Exception e) { TempData["error"] = e.Message; } return(RedirectToAction(nameof(Index))); }
public ActionResult Delete(int id, CategoryDto dto) { try { _deleteCommand.Execute(id); return(RedirectToAction("Index")); } catch (EntityNotFoundException) { TempData["error"] = "Category doesn't exist."; return(RedirectToAction(nameof(Index))); } catch (Exception) { TempData["error"] = "Error"; return(RedirectToAction(nameof(Index))); } }
public IActionResult Delete(int id) { // 505 try { _deleteCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException) { return(NotFound()); } catch (EntityDeleted) { return(StatusCode(410, "The Category is already Deleted")); } catch (Exception) { return(StatusCode(500, "An error occured.")); } }