Exemple #1
0
        public IActionResult GetImageById([FromRoute] int imageId)
        {
            if (imageId <= 0 || imageId > int.MaxValue)
            {
                return(BadRequest());
            }
            try
            {
                var imageList = _healthservice.GetImageById(imageId);
                if (imageList != null)
                {
                    return(new JsonResult(imageList));
                }
                else
                {
                    return(new JsonResult("No records found"));
                }
            }

            catch (Exception ex)
            {
                log.Info(ex);
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }