public ActionResult Edit(District district) { if (ModelState.IsValid) { context.Entry(district).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } return View(district); }
public ActionResult Create(District district) { if (ModelState.IsValid) { context.Districts.Add(district); context.SaveChanges(); return RedirectToAction("Index"); } return View(district); }