public ActionResult <bool> Delete(int id) { if (DAInvestment.Delete(id, out error)) { return(new OkObjectResult(true)); } return(NotFound(error)); }
public bool Investment_Delete(int INVE_ID) { try { return(DAInvestment.Delete(INVE_ID)); } catch (Exception ex) { myServiceData.Result = false; myServiceData.ErrorMessage = "unforeseen error occured. Please try later."; myServiceData.ErrorDetails = ex.ToString(); throw new FaultException <ServiceData>(myServiceData, ex.ToString()); } }
public IActionResult Delete(int id) { Investment investment = investmentManager.Get(id); if (investment == null) { return(NotFound("Investment couldn't be found")); } if (investmentManager.Delete(investment) == 1) { return(Ok(true)); } else { return(BadRequest(false)); } }