public ActionResult Edit(Tutorial tutorial) { if (ModelState.IsValid) { db.Entry(tutorial).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(tutorial); }
public ActionResult Create(Tutorial tutorial) { if (ModelState.IsValid) { db.Tutorial.Add(tutorial); db.SaveChanges(); return RedirectToAction("Index"); } return View(tutorial); }