Ejemplo n.º 1
0
 public ActionResult Edit(Monster monster)
 {
     if (ModelState.IsValid)
     {
         MonsterHelper.CalculateMonsterStats(monster);
         db.Entry(monster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(monster));
 }
Ejemplo n.º 2
0
        public ActionResult Create(Monster monster)
        {
            if (ModelState.IsValid)
            {
                MonsterHelper.CalculateMonsterStats(monster);
                db.Monsters.Add(monster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(monster));
        }