public ActionResult Create(Player player) { if (ModelState.IsValid) { db.Players.Add(player); db.SaveChanges(); return RedirectToAction("Index"); } return View(player); }
public ActionResult Edit(Player player) { if (ModelState.IsValid) { db.Entry(player).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(player); }