public ActionResult Edit(Course group) { if (ModelState.IsValid) { db.Entry(group).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Details", new { id = group.Id }); } return View(group); }
public ActionResult Create(Course course) { if (ModelState.IsValid) { db.Courses.Add(course); db.SaveChanges(); return RedirectToAction("Index"); } return View(course); }