Exemplo n.º 1
0
 public ActionResult <VaultKeep> GetById(int id)
 {
     try
     {
         return(Ok(_service.GetById(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult <VaultKeep> Get(int id)
 {
     try
     {
         return(Ok(_vks.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     };
 }
 public ActionResult <VaultKeep> GetById(int vaultKeepId)
 {
     try
     {
         return(Ok(_vks.GetById(vaultKeepId)));
     }
     catch (Exception exception)
     {
         return(BadRequest(exception.Message));
     }
 }
Exemplo n.º 4
0
        public ActionResult <Vault> Get(int vid)
        {
            try
            {
                var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;

                return(Ok(_vks.GetById(vid, userId)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemplo n.º 5
0
 public ActionResult <IEnumerable <Keep> > GetById(int vaultId)
 {
     try
     {
         string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         // send to vault service to check if vault id is valid and belongs to user
         var vault = _vs.GetById(vaultId, userId);
         return(Ok(_vks.GetById(vault)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }