public ActionResult <IEnumerable <Vault> > Get() { var userId = HttpContext.User.Identity.Name; IEnumerable <Vault> results = _vr.GetByUserId(userId); if (results == null) { return(BadRequest()); } return(Ok(results)); }
public ActionResult <IEnumerable <Vault> > GetAll() { string userId = HttpContext.User.Identity.Name; IEnumerable <Vault> result = _repo.GetByUserId(userId); if (result != null) { return(Ok(result)); } return(BadRequest()); }
public ActionResult <IEnumerable <Vault> > GetByUser() { var user = HttpContext.User.FindFirstValue("Id"); try { return(Ok(_repo.GetByUserId(user))); } catch (Exception e) { return(BadRequest(e)); } }
public IEnumerable <Vault> GetVaultsByActiveUser() { var user = HttpContext.User; var id = user.Identity.Name; UserReturnModel activeUser = null; if (id != null) { activeUser = userDb.GetUserById(id); } var uid = activeUser.Id; return(vaultDb.GetByUserId(uid)); }
public IEnumerable <Vault> GetByUserId() { string uid = HttpContext.User.Identity.Name; return(_vaultRepo.GetByUserId(uid)); }
public IEnumerable <Vault> GetByUserId(string userId) { return(_repo.GetByUserId(userId)); }