public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Payee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayeeExists(Payee.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Transaction).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransactionExists(Transaction.TransactionID)) { return(NotFound()); } else { throw; } } PopulatePayeesDropDownList(_context, Transaction.PayeeID); PopulateAccountsDropDownList(_context, Transaction.AccountID); return(RedirectToPage("./Index")); }