Esempio n. 1
0
 public ActionResult Edit(Tarea tarea)
 {
     if (ModelState.IsValid)
     {
         context.Entry(tarea).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tarea);
 }
Esempio n. 2
0
        public ActionResult Create(Tarea tarea)
        {
            if (ModelState.IsValid)
            {
                context.Tareas.Add(tarea);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tarea);
        }