public ActionResult Create(PlayerType playertype) { if (ModelState.IsValid) { _repository.AddItem(playertype); return RedirectToAction("Index"); } return View(playertype); }
public ActionResult Create(PlayerType playertype) { if (ModelState.IsValid) { db.PlayerTypes.Add(playertype); db.SaveChanges(); return RedirectToAction("Index"); } return View(playertype); }
public ActionResult Edit(PlayerType playertype) { if (ModelState.IsValid) { db.Entry(playertype).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(playertype); }