public IActionResult UpdateFull(int id, [FromBody] Loan loan, [FromServices] LoanDb db) { if (loan == null) { return(StatusCode((int)HttpStatusCode.BadRequest, new { error = "cannot update with null entity" })); } int rowsAffected = _loanDao.UpdateFull(id, loan, db); return(Ok(new { rowsaffected = rowsAffected })); }
public IActionResult UpdateFull(int id, [FromBody] Loan loan, [FromServices] LoanDb db) { if (loan == null) { return(StatusCode((int)HttpStatusCode.BadRequest, new { error = "cannot update with null entity" })); } int rowsAfected = _loanDao.UpdateFull(id, loan, db); if (rowsAfected <= 0) { return(StatusCode((int)HttpStatusCode.InternalServerError, new { error = "error occurred while fully updaing loan" })); } return(Ok()); }