public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Seat = await _context.Seats.SingleOrDefaultAsync(m => m.ID == id); if (Seat == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Seat = await _context.Seats.FindAsync(id); if (Seat != null) { _context.Seats.Remove(Seat); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }