示例#1
0
        public ActionResult <string> Delete(int id)
        {
            bool successful = _tr.Delete(id);

            if (successful)
            {
                return(BadRequest("Failed to delete vault"));
            }
            return(Ok());
        }
示例#2
0
 public ActionResult <string> Delete(int id)
 {
     try
     {
         return(Ok(_repo.Delete(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
示例#3
0
        public ActionResult <string> Delete(int id)
        {
            bool wasSuccessful = _vr.Delete(id);

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

            return(BadRequest());
        }
示例#4
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));
     }
 }
示例#5
0
 public bool Delete([FromBody] VaultToDelete vault)
 {
     if (!ModelState.IsValid)
     {
         throw new Exception("Invalid information.");
     }
     if (vault.UserId != vault.SendingUserId)
     {
         throw new Exception("you can't delete a vault that's not yours.");
     }
     return(_repo.Delete(vault.Id));
 }
        public ActionResult <string> Delete(int id)
        {
            // var UserId = HttpContext.User.Identity.Name;
            // if (UserId == Vault.UserId)
            bool successful = _vr.Delete(id);

            if (!successful)
            {
                return(BadRequest("Unable to DELETE: Delete was not successful."));
            }
            return(Ok());
        }
示例#7
0
 public int Delete(int id)
 {
     return(_repo.Delete(id));
 }
 public void Delete(int vaultId)
 {
     _repo.Delete(vaultId);
     return;
 }
示例#9
0
 public void Delete(int id)
 {
     _repo.Delete(id);
 }
示例#10
0
 public bool Delete(int id)
 {
     return(_repo.Delete(id));
 }
示例#11
0
 public void Delete([FromRoute] int id)
 {
     _repo.Delete(id);
 }