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