public ActionResult Create(UserItem useritem) { if (ModelState.IsValid) { context.UserItems.Add(useritem); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleItemValues = context.ItemValues; return View(useritem); }
public ActionResult Edit(UserItem useritem) { if (ModelState.IsValid) { context.Entry(useritem).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleItemValues = context.ItemValues; return View(useritem); }