public ActionResult Create(Match match) { if (ModelState.IsValid) { context.Matches.Add(match); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleHomeTeams = context.Teams; ViewBag.PossibleAwayTeams = context.Teams; ViewBag.PossibleFixtures = context.Fixtures; return View(match); }
public ActionResult Edit(Match match) { if (ModelState.IsValid) { context.Entry(match).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleHomeTeams = context.Teams; ViewBag.PossibleAwayTeams = context.Teams; ViewBag.PossibleFixtures = context.Fixtures; return View(match); }