Beispiel #1
0
 public ActionResult Edit(Game game)
 {
     if (ModelState.IsValid)
     {
         context.Entry(game).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(game);
 }
Beispiel #2
0
        public ActionResult Create(Game game)
        {
            if (ModelState.IsValid)
            {
                context.Games.Add(game);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(game);
        }