Пример #1
0
        public ActionResult <Keep> Get(int id)
        {
            Keep result = _repo.GetKeepById(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
Пример #2
0
        public ActionResult <Keep> GetAction(int id)
        {
            Keep result = _keepRepo.GetKeepById(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(NotFound());
        }
 public ActionResult <Keep> Get(int id)
 {
     try
     {
         return(Ok(_repository.GetKeepById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #4
0
        public ActionResult <Keep> GetKeep(int id)
        {
            //your hitting this endpoint because in your store you need to have 'keeps/user' in your api.get
            //see line 39
            Keep result = _repo.GetKeepById(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(NotFound());
        }