Example #1
0
        public ActionResult Create(Competition competition)
        {
            if (ModelState.IsValid)
            {
                db.Competitions.Add(competition);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(competition);
        }
Example #2
0
 public ActionResult Edit(Competition competition)
 {
     if (ModelState.IsValid)
     {
         db.Entry(competition).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(competition);
 }