示例#1
0
        public ActionResult <IEnumerable <Keep> > GetAll()
        {
            string             userId = HttpContext.User.Identity.Name;
            IEnumerable <Keep> result = _repo.GetByUserId(userId);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
示例#2
0
        public ActionResult <Keep> GetByUserId()
        {
            string             userId = HttpContext.User.Identity.Name;
            IEnumerable <Keep> found  = _kr.GetByUserId(userId);

            if (found == null)
            {
                return(BadRequest("No"));
            }
            return(Ok(found));
        }
示例#3
0
        public ActionResult <IEnumerable <Keep> > GetById()
        {
            var userId = HttpContext.User.Identity.Name;
            IEnumerable <Keep> results = _kr.GetByUserId(userId);

            if (results == null)
            {
                return(BadRequest());
            }
            return(Ok(results));
        }
示例#4
0
        public ActionResult <IEnumerable <Keep> > GetByUser()
        {
            var user = HttpContext.User.FindFirstValue("Id");

            try
            {
                return(Ok(_repo.GetByUserId(user)));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
示例#5
0
        public IEnumerable <Keep> GetKeepsByActiveUser()
        {
            Console.WriteLine("GetKeepsByActiveUser called!");

            var user = HttpContext.User;
            var id   = user.Identity.Name;

            UserReturnModel activeUser = null;

            if (id != null)
            {
                activeUser = userDb.GetUserById(id);
            }
            var uid = activeUser.Id;

            return(keepDb.GetByUserId(uid));
        }
示例#6
0
        public IEnumerable <Keep> Get()
        {
            string uid = HttpContext.User.Identity.Name;

            return(_keepRepo.GetByUserId(uid));
        }