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