public IEnumerable <Keep> GetByUserId(string id) { if (ModelState.IsValid) { return(_db.GetByUserId(id)); } return(null); }
public ActionResult <IEnumerable <Keep> > GetByUser() { string UserId = HttpContext.User.Identity.Name; IEnumerable <Keep> keepList = _kr.GetByUserId(UserId); if (keepList != null) { return(Ok(keepList)); } return(BadRequest("Could not collect list of keeps")); }
public ActionResult<IEnumerable<Keep>> GetByUser() { try { var userid = HttpContext.User.FindFirstValue("Id"); // THIS IS HOW YOU GET THE ID of the currently logged in user return Ok(_repo.GetByUserId(userid)); } catch (Exception e) { return BadRequest(e); } }
public IEnumerable <Keep> GetByUserId(int id) { return(_db.GetByUserId(id)); }
public IEnumerable <Keep> GetKeepsByUser(int id) { return(keepDb.GetByUserId(id)); }
public IEnumerable <Keep> GetByUser(int userId) { return(db.GetByUserId(userId)); }