コード例 #1
0
        public async Task <ActionResult> Put([FromBody] ParametroDTOUpdate parametro)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var result = await _service.Put(parametro);

                if (result != null)
                {
                    return(Ok(await _service.Get(result.Idparametro)));
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }