public ActionResult Create(Users users) { if (ModelState.IsValid) { users.UserId = Guid.NewGuid(); db.Users.Add(users); db.SaveChanges(); return RedirectToAction("Index"); } return View(users); }
public ActionResult Edit(Users users) { if (ModelState.IsValid) { db.Entry(users).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(users); }