public ActionResult Create(Team team) { if (ModelState.IsValid) { using (var context = new FootballManagerDBContext()) { context.Teams.Add(team); context.SaveChanges(); } return RedirectToAction("Index"); } return View(team); }
public ActionResult Edit(Team team) { if (ModelState.IsValid) { using (var context = new FootballManagerDBContext()) { context.Entry(team).State = EntityState.Modified; context.SaveChanges(); } return RedirectToAction("Index"); } return View(team); }