Example #1
0
        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());
        }
Example #3
0
        public ActionResult <string> Delete(int id)
        {
            bool wasSuccessful = _kr.Delete(id);

            if (wasSuccessful)
            {
                return(Ok());
            }

            return(BadRequest());
        }
Example #4
0
 public ActionResult <string> Delete(int id)
 {
     try
     {
         return(Ok(_repo.Delete(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Example #5
0
 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));
 }
Example #6
0
 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));
     }
 }
Example #7
0
        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));
            }
        }
Example #8
0
 public void Delete(int id)
 {
     _repo.Delete(id);
     return;
 }
Example #9
0
 public int Delete(int id)
 {
     return(_repo.Delete(id));
 }
Example #10
0
 public void Delete(int id)
 {
     _repo.Delete(id);
 }
Example #11
0
 public bool Delete(int id)
 {
     return(_repo.Delete(id));
 }
Example #12
0
 public void Delete(int keepId)
 {
     _repo.Delete(keepId);
     return;
 }
Example #13
0
 public void Delete([FromRoute] int id)
 {
     _repo.Delete(id);
 }