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