Exemple #1
0
        public ActionResult Create(Actor actor)
        {
            if (ModelState.IsValid)
            {
                db.Actores.Add(actor);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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