//Takes in a course public async Task <Course> UpdateCourse(Course updatedCourse) { var addedCourse = _classDbContext.Update(updatedCourse); await _classDbContext.SaveChangesAsync(); return(updatedCourse); }
public async Task <IActionResult> Edit(int id, [Bind("AssessmentId,Name,Date,Points")] Assessment assessment) { if (id != assessment.AssessmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(assessment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssessmentExists(assessment.AssessmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(assessment)); }