示例#1
0
 public IEnumerable <Keep> GetByUserId(string id)
 {
     if (ModelState.IsValid)
     {
         return(_db.GetByUserId(id));
     }
     return(null);
 }
示例#2
0
        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"));
        }
示例#3
0
 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);
   }
 }
示例#4
0
 public IEnumerable <Keep> GetByUserId(int id)
 {
     return(_db.GetByUserId(id));
 }
示例#5
0
 public IEnumerable <Keep> GetKeepsByUser(int id)
 {
     return(keepDb.GetByUserId(id));
 }
示例#6
0
 public IEnumerable <Keep> GetByUser(int userId)
 {
     return(db.GetByUserId(userId));
 }