Exemple #1
0
 public ActionResult Edit(Game game)
 {
     if (ModelState.IsValid)
     {
         context.Games.Update(game);
         return RedirectToAction("Index");
     }
     return View(game);
 }
Exemple #2
0
        public ActionResult Create(Game game)
        {
            if (ModelState.IsValid)
            {
                context.Games.Insert(game);
                return RedirectToAction("Index");
            }

            return View(game);
        }