public IHttpActionResult AddInvestment(InvestmentDto input) { try { InvestmentService _investmentService = new InvestmentService(); var response = _investmentService.AddInvestment(input); return !response.Success ? (IHttpActionResult)BadRequest(response.Message) : (IHttpActionResult)Ok(response); } catch (Exception ex) { return InternalServerError(ex); } }
public IHttpActionResult DeleteInvestment(InvestmentDto input) { try { InvestmentService _investmentService = new InvestmentService(); var response = _investmentService.DeleteInvestment(input); return !response.Success ? (IHttpActionResult) BadRequest(response.Message) : (IHttpActionResult) Ok(response); } catch (Exception ex) { return null; } }