public async Task <ActionResult> Delete(int id) { try { if (id != 0) { var customerinDb = await _ILoan.LoanListById(id); if (customerinDb == null) { return(NotFound()); } _ILoan.DeleteLoan(id); return(NoContent()); } else { return(StatusCode(StatusCodes.Status406NotAcceptable)); } } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex)); } }