示例#1
0
        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));
        }
示例#2
0
        public ActionResult <IEnumerable <Vault> > Get()
        {
            string userId = HttpContext.User.FindFirstValue("Id");

            try
            {
                return(Ok(_repo.GetVaults(userId)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
示例#3
0
 public IEnumerable <Vault> Get() => _repo.GetVaults(HttpContext.User.Identity.Name);