public IEnumerable <Keep> GetUserKeeps() { var user = HttpContext.User; var id = user.Identity.Name; return(_repo.GetKeepsByUserId(id)); }
// get keeps by userId public ActionResult <IEnumerable <Keep> > GetKeeps(string userId) { var id = HttpContext.User.Identity.Name; IEnumerable <Keep> result = _repo.GetKeepsByUserId(id); if (result != null) { return(Ok(result)); } return(BadRequest()); }
public ActionResult <Keep> GetKeepsByUserId() { try { string userId = HttpContext.User.FindFirstValue("Id"); return(Ok(_repository.GetKeepsByUserId(userId))); } catch { return(BadRequest("NOpe UserID or something is wrong")); } }
public ActionResult <IEnumerable <Keep> > GetKeepsByUserId() { try { var id = HttpContext.User.FindFirstValue("Id"); return(Ok(_repo.GetKeepsByUserId(id))); } catch (Exception e) { return(BadRequest(e)); } }