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