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