public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(BankTransactionCategory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BankTransactionCategoryExists(BankTransactionCategory.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.BankTransactions.Add(BankTransaction); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } BankAccount = await _context.BankAccounts.FindAsync(id); if (BankAccount != null) { _context.BankAccounts.Remove(BankAccount); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Player = await _context.Players.FindAsync(id); if (Player != null) { _context.Players.Remove(Player); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } AppRole = await _context.AppRole.FindAsync(id); if (AppRole != null) { _context.AppRole.Remove(AppRole); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }