Esempio n. 1
0
        public int AddView(int id)
        {
            Keep keep = _repo.GetById(id);

            keep.Views++;
            _repo.Update(keep);
            return(keep.Views);
        }
Esempio n. 2
0
 public IActionResult GetById([FromRoute] int id)
 {
     try {
         return(Ok(_repo.GetById(id)));
     } catch (Exception error) {
         return(BadRequest(error.Message));
     }
 }
Esempio n. 3
0
        public ActionResult <Keep> Get(int id)
        {
            Keep result = _keepRepo.GetById(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
        public ActionResult <Keep> Get(int id)
        {
            Keep found = _kr.GetById(id);

            if (found == null)
            {
                return(BadRequest("Something has gone horribly wrong"));
            }
            return(Ok(found));
        }
Esempio n. 5
0
        public ActionResult <Keep> Get(int id)
        {
            Keep found = _pr.GetById(id);

            if (found == null)
            {
                return(BadRequest());
            }
            return(Ok(found));
        }
Esempio n. 6
0
 public ActionResult <Keep> GetById(int id)
 {
     try
     {
         return(Ok(_repo.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
Esempio n. 7
0
 public Keep GetbyId(int id)
 {
     return(_repo.GetById(id));
 }
Esempio n. 8
0
 public IEnumerable <Keep> GetById(string userId)
 {
     userId = HttpContext.User.Identity.Name;
     return(_repo.GetById(userId));
 }
Esempio n. 9
0
 public IEnumerable <Keep> Get(string userid)
 {
     return(_repo.GetById(userid));
 }