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