Exemple #1
0
        public IActionResult GetById(int id)
        {
            var activity = _repo.Get(id);

            if (activity == null)
            {
                return(NotFound("Activity not found"));
            }

            return(Ok(activity));
        }
Exemple #2
0
        // return 404 if not found
        // return 200 if single record found
        public IHttpActionResult Get(int id)
        {
            var result = _activitiesRepository.Get(id);

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

            return(Ok(result));
        }
Exemple #3
0
 public IHttpActionResult Get(int id)
 {
     return(Ok(_activitiesRepository.Get(id)));
 }