public ActionResult Edit(Course course) { if (ModelState.IsValid) { context.Entry(course).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } return View(course); }
public ActionResult Create(Course course) { if (ModelState.IsValid) { context.Courses.Add(course); context.SaveChanges(); return RedirectToAction("Index"); } return View(course); }