Ejemplo n.º 1
0
        public IHttpActionResult DeleteMedicamento(long id)
        {
            Medicamento medicamento;

            try
            {
                medicamento = medicamentoService.Delete(id);
            }
            catch (NoEncontradoException)
            {
                return(NotFound());
            }

            return(Ok(medicamento));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Delete(Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                return(Ok(await _service.Delete(id)));
            }
            catch (ArgumentException e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
            }
        }