public ActionResult <IEnumerable <Vault> > GetVaultsById() { string UserId = HttpContext.User.Identity.Name; IEnumerable <Vault> allVaults = _vr.GetVaults(UserId); if (allVaults == null) { return(BadRequest()); } return(Ok(allVaults)); }
public ActionResult <IEnumerable <Vault> > Get() { string userId = HttpContext.User.FindFirstValue("Id"); try { return(Ok(_repo.GetVaults(userId))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IEnumerable <Vault> Get() => _repo.GetVaults(HttpContext.User.Identity.Name);