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