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()); }
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)); }
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)); }
public ActionResult <IEnumerable <Keep> > GetByUser() { var user = HttpContext.User.FindFirstValue("Id"); try { return(Ok(_repo.GetByUserId(user))); } catch (Exception e) { return(BadRequest(e)); } }
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)); }
public IEnumerable <Keep> Get() { string uid = HttpContext.User.Identity.Name; return(_keepRepo.GetByUserId(uid)); }