public ActionResult Edit([Bind(Include = "Id,Description")] Team team) { if (ModelState.IsValid) { db.Entry(team).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(team)); }
public ActionResult Edit([Bind(Include = "Id,Description,HomeTeamId,AwayTeamId,HomeScore,AwayScore,GameDateTime,Network,IsGameFinished,HomeSelectedCount,AwaySelectedCount")] Game game) { if (ModelState.IsValid) { db.Entry(game).State = EntityState.Modified; db.SaveChanges(); DoCalc(); return(RedirectToAction("Index")); } ViewBag.AwayTeamId = new SelectList(db.Teams, "Id", "Description", game.AwayTeamId); ViewBag.HomeTeamId = new SelectList(db.Teams, "Id", "Description", game.HomeTeamId); return(View(game)); }