public IActionResult Delete(int id) { try { deleteUser.Execute(id); return(StatusCode(204)); } catch (EntityNotFoundException e) { return(NotFound(new { Errors = new List <string> { e.Message } })); } catch (Exception e) { return(StatusCode(500, new { Errors = new List <string> { e.Message } })); } }
public dynamic DeleteUser() { Guid userId = Request.Form["id"]; _deleteUserCommand.Execute(userId); return(HttpStatusCode.OK); }
public void Execute_ValidationSucceeds_StatementsExecuted() { // execute _deleteUserCommand.Execute(Guid.NewGuid()); // assert _dbContext.Received(1).ExecuteNonQuery(Arg.Any <string>(), Arg.Any <object>()); }
public IActionResult Delete(int id) { try { _deleteUser.Execute(id); return(StatusCode(204)); } catch (NotFoundException) { return(NotFound()); } }
public IActionResult Delete(int id) { try { _deleteUserCommand.Execute(id); return(StatusCode(204, "Successfully deleted user.")); } catch (EntityNotFoundException) { return(NotFound()); } }
public IActionResult Delete(int id) { try { _deleteUsersCommand.Execute(id); return(NoContent()); } catch (EntityNotFoundException) { return(Conflict("That news is already deleted.")); } }
public ActionResult Delete(int id, IFormCollection collection) { try { _deleteUserCommand.Execute(id); return(RedirectToAction(nameof(Index))); } catch (EntityNotFoundException ex) { TempData["error"] = ex.Message; return(View()); } }
// GET: Users/Delete/5 public ActionResult Delete(int id) { try { _deleteUser.Execute(id); return(RedirectToAction(nameof(Index))); } catch (Exception) { TempData["error"] = "Some error occurred. Please try again."; return(RedirectToAction(nameof(Index))); } }
public IActionResult Delete(string id) { try { _deleteUser.Execute(id); return(NoContent()); } catch (EntityNotFoundException) { return(Conflict()); } catch { return(StatusCode(500, serverErrorMessage)); } }
public ActionResult Delete(int id) { try { _deleteUserCommand.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 { _deleteUser.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception) { return(StatusCode(500, "Server error")); } }
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 { deleteUser.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { return(UnprocessableEntity(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public ActionResult <IEnumerable <UserDTO> > Delete(UserDTO dto) { try { _deleteUserCommand.Execute(dto); return(NoContent()); } catch (EntityNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500)); } }
public ActionResult Delete(int id) { try { _deleteUserCommand.Execute(id); return(NoContent()); } catch (DataNotFoundException) { return(NotFound()); } catch (Exception) { return(StatusCode(500, "Server is currently under construction, please try later")); } }
public ActionResult Delete(int id, UserDTO dto) { try { _deleteUser.Execute(dto); return(RedirectToAction(nameof(Index))); } catch (EntityNotFoundException) { return(View()); } catch (Exception) { return(RedirectToAction("index")); } }
public IActionResult Delete(int id) { try { _deleteUser.Execute(id); return(Ok()); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public ActionResult Delete(int id) { try { _deleteUserCommand.Execute(id); return(StatusCode(204, "User is deleted")); }catch (AlredyExistException) { return(Conflict("User is alredy deleted")); }catch (NotFoundException) { return(NotFound()); }catch (Exception) { return(StatusCode(500, "Server error, try later")); } }
public ActionResult Delete(int id) { try { _deleteUserCommand.Execute(id); TempData["success"] = "User deleted."; } catch (EntityNotFoundException e) { TempData["error"] = e.Message; } catch (Exception e) { TempData["error"] = e.Message; } return(RedirectToAction(nameof(Index))); }
public ActionResult Delete(int id, IFormCollection collection) { try { // TODO: Add delete logic here _deleteUser.Execute(id); return(RedirectToAction(nameof(Index))); } catch (EntityNotFoundException e) { TempData["Errors"] = e.Message; } catch (Exception e) { TempData["Errors"] = e.Message; } return(View()); }
public IActionResult Delete(int id) { 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")); } }
// GET: User/Delete/5 public ActionResult Delete(string id) { _deleteUser.Execute(id); return(RedirectToAction(nameof(Index))); }
public IHttpActionResult DeleteUser(int id) { _deleteUserCommand.Execute(id); return(Ok()); }
public IActionResult Delete(int id, [FromServices] IDeleteUserCommand command) { command.Execute(id); return(NoContent()); }