public ActionResult <string> Delete(int id) { bool successful = _pr.Delete(id); if (successful) { return(BadRequest("Failed to delete keep")); } return(Ok()); }
public ActionResult <string> Delete(int id) { bool successful = _kr.Delete(id); if (!successful) { return(BadRequest("Unable to DELETE: Delete was not successful.")); } return(Ok()); }
public ActionResult <string> Delete(int id) { bool wasSuccessful = _kr.Delete(id); if (wasSuccessful) { return(Ok()); } return(BadRequest()); }
public ActionResult <string> Delete(int id) { try { return(Ok(_repo.Delete(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public bool Delete([FromBody] KeepToDelete payload) { if (!ModelState.IsValid) { throw new Exception("Invalid information sent."); } if (payload.UserId != payload.SendingUserId) { throw new Exception("You cannot delete a keep you didn't author."); } return(_repo.Delete(payload.Id)); }
public ActionResult <string> Delete(int id) { try { string uid = HttpContext.User.FindFirstValue("Id"); return(Ok(_repo.Delete(id, uid))); } catch (Exception e) { return(BadRequest(e)); } }
public ActionResult <String> Delete(int keepId) { string userId = HttpContext.User.FindFirstValue("Id"); try { return(Ok(_repo.Delete(keepId, userId))); } catch (Exception e) { return(BadRequest(e)); } }
public void Delete(int id) { _repo.Delete(id); return; }
public int Delete(int id) { return(_repo.Delete(id)); }
public void Delete(int id) { _repo.Delete(id); }
public bool Delete(int id) { return(_repo.Delete(id)); }
public void Delete(int keepId) { _repo.Delete(keepId); return; }
public void Delete([FromRoute] int id) { _repo.Delete(id); }