Ejemplo n.º 1
0
        public IHttpActionResult PutMedicamento(long id, Medicamento medicamento)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != medicamento.Id)
            {
                return(BadRequest());
            }

            try
            {
                medicamentoService.Update(medicamento);
            }
            catch (NoEncontradoException)
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }