public async Task <IActionResult> PutLoan(int id, Loan loan) { if (id != loan.LoanId) { return(BadRequest()); } _context.Entry(loan).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LoanExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPaymentType(int id, PaymentType paymentType) { if (id != paymentType.PaymentTypeID) { return(BadRequest()); } _context.Entry(paymentType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }