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