public async Task <IActionResult> PutBankAccount(int id, BankAccount bankAccount) { if (id != bankAccount.BankAccountID) { return(BadRequest()); } _context.Entry(bankAccount).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BankAccountExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBank(int id, Bank bank) { if (id != bank.BankID) { return(BadRequest()); } _context.Entry(bank).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (Exception) { if (!BankExists(id)) { return(NotFound()); } throw; } return(NoContent()); }