Beispiel #1
0
 public IActionResult GetById([FromRoute] int id)
 {
     try {
         return(Ok(_repo.GetById(id, HttpContext.User.Identity.Name)));
     } catch (Exception error) {
         return(BadRequest(error.Message));
     }
 }
Beispiel #2
0
        public ActionResult <Vault> Get(int id)
        {
            Vault found = _tr.GetById(id);

            if (found == null)
            {
                return(BadRequest());
            }
            return(Ok(found));
        }
Beispiel #3
0
        public ActionResult <Vault> Get(int id)
        {
            Vault result = _vaultRepo.GetById(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
Beispiel #4
0
 public ActionResult <Vault> GetById(int id)
 {
     try
     {
         return(Ok(_repo.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
Beispiel #5
0
 public ActionResult <IEnumerable <Vault> > Get()
 {
     try
     {
         var id = HttpContext.User.FindFirstValue("Id");
         return(Ok(_repo.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
Beispiel #6
0
 public Vault GetbyId(int id)
 {
     return(_repo.GetById(id));
 }
Beispiel #7
0
 public IEnumerable <Vault> GetUserVaults(string userid)
 {
     return(_repo.GetById(userid));
 }
 public Vault GetById(int vaultId)
 {
     return(_repo.GetById(vaultId));
 }