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