public IHttpActionResult DeleteMedicamento(long id) { Medicamento medicamento; try { medicamento = medicamentoService.Delete(id); } catch (NoEncontradoException) { return(NotFound()); } return(Ok(medicamento)); }
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)); } }