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