public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Beginn,Ende")] Kurs kurs) { if (id != kurs.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(kurs); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KursExists(kurs.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(kurs)); }