Пример #1
0
 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);
     }
 }
Пример #2
0
        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;
            }
        }