public ActionResult Create(UserItemList useritemlist) { if (ModelState.IsValid) { context.UserItemLists.Add(useritemlist); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleUsers = context.Users; return View(useritemlist); }
public ActionResult Edit(UserItemList useritemlist) { if (ModelState.IsValid) { context.Entry(useritemlist).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleUsers = context.Users; return View(useritemlist); }