Exemplo n.º 1
0
        public ActionResult Create(Trick trick)
        {
            if (ModelState.IsValid)
            {
                _db.Tricks.Add(trick);
                _db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(trick);
        }
Exemplo n.º 2
0
 public ActionResult Edit(Trick trick)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(trick).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(trick);
 }