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