public void DeleteLoanTest() { int maxID = _loans.Max(a => a.Id); // Before removal var lastLoan = _loans.Last(); // Remove last Loan _loanService.DeleteLoan(lastLoan.Id); Assert.That(maxID, Is.GreaterThan(_loans.Max(a => a.Id))); }
public async Task <ActionResult <Result> > DeleteCurrency(long loanId) { var result = await _loanService.DeleteLoan(new LoanDto { Id = loanId }); if (!result.Succeeded) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <IActionResult> RemoveLoanById([FromRoute] Guid id) { try { var response = await _service.DeleteLoan(id); return(Json(response.Object)); } catch (Exception ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message)); } }
public async Task <IActionResult> Delete([FromRoute] int id) { return(HandleResponse(await _loanService.DeleteLoan(id))); }