示例#1
0
        public ActionResult Create(Tarea tarea)
        {
            if (ModelState.IsValid)
            {
                db.Tareas.Add(tarea);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tarea);
        }
示例#2
0
 public ActionResult Edit(Tarea tarea)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tarea).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tarea);
 }