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