public ActionResult <IEnumerable <VaultKeep> > Get() { try { return(Ok(_vks.Get())); } catch (Exception e) { return(BadRequest(e.Message)); }; }
public ActionResult <IEnumerable <VaultKeep> > Get() { try { var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value; return(Ok(_vks.Get())); } catch (Exception e) { return(BadRequest(e.Message)); }; }
public ActionResult <IEnumerable <VaultKeep> > Get() { try { return(Ok(_vaultKeepsService.Get())); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <int> Get(int vaultid, int keepid) { try { return(Ok(_serve.Get(vaultid, keepid))); } catch (Exception error) { return(BadRequest(error.Message)); } }
public ActionResult <IEnumerable <Keep> > Get(int vaultId) { try { string userId = HttpContext.User.FindFirstValue("Id"); return(Ok(_vks.Get(vaultId, userId))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <IEnumerable <Keep> > Get(int vaultId) { try { string reqUserId = HttpContext.User.FindFirstValue("Id"); User user = _as.GetUserById(reqUserId); Vault vault = _vs.Get(vaultId, user.Id); //This checks to make sure the user owns the vault IEnumerable <VaultKeep> vKeeps = _vks.Get(vaultId, user.Id); return(Ok(vKeeps)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <IEnumerable <VaultKeepViewModel> > Get(int vaultId) { try { Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier); if (user == null) { throw new Exception("You must be logged in."); } return(Ok(_vks.Get(vaultId, user.Value))); } catch (Exception err) { return(BadRequest(err.Message)); } }
public ActionResult <IEnumerable <VaultKeepViewModel> > Get(int id) { try { var user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier); if (user == null) { throw new Exception("Please Login to Continue!"); } return(Ok(_vk.Get(id, user.Value))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <IEnumerable <VaultKeep> > Get() { try { Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier); if (user == null) { throw new Exception("You must be logged in"); } string userId = user.Value; return(Ok(_vks.Get(userId))); } catch (Exception e) { return(BadRequest(e.Message)); }; }
public ActionResult <IEnumerable <Keep> > Get([FromRoute] int vaultId) { try { string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value; IEnumerable <VaultKeeps> vks = _vks.Get(userId, vaultId); List <Keep> keps = new List <Keep>(); foreach (VaultKeeps vk in vks) { keps.Add(_ks.GetById(vk.KeepId, userId)); } return(keps); } catch (Exception e) { return(BadRequest(e.Message)); } }