public async Task <IActionResult> Edit(Guid id, [Bind("ID,LastName,FirstMidName,Email,EnrollmentDate")] Camper camper) { if (id != camper.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(camper); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CamperExists(camper.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(camper)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ID,Title,Credits")] Course course) { if (id != course.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(course); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CourseExists(course.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(course)); }