示例#1
0
 public ActionResult <bool> Delete(int id)
 {
     if (DAInvestment.Delete(id, out error))
     {
         return(new OkObjectResult(true));
     }
     return(NotFound(error));
 }
示例#2
0
 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());
     }
 }
示例#3
0
        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));
            }
        }