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