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