Пример #1
0
        public ActionResult <Vault> GetVault(int vaultid)
        {
            Vault result = _repo.GetVaultById(vaultid);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
Пример #2
0
 public ActionResult <Vault> Get(int id)
 {
     try
     {
         return(Ok(_repo.GetVaultById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #3
0
 public ActionResult <Vault> GetVaultById(int id, string userId)
 {
     try
     {
         // string userId = HttpContext.User.FindFirstValue("Id"); //stacko //FIXME CANNOT READ PROPERTY 'ID' OF UNDEFINED
         return(Ok(_repository.GetVaultById(id, userId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #4
0
 public ActionResult <Vault> GetOne(int id)
 {
     return(Ok(_vaultRepo.GetVaultById(id)));
 }