Exemple #1
0
        public IActionResult AddImage([FromForm] AddImageModel input)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (input == null)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                _healthservice.AddImage(input);
                return(new JsonResult("Image inserted successfully"));
            }
            catch (Exception ex)
            {
                log.Info(ex);
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }