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