Ejemplo n.º 1
0
 public ActionResult Edit(Activity activity)
 {
     if (ModelState.IsValid)
     {
         context.Entry(activity).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(activity);
 }
Ejemplo n.º 2
0
        public ActionResult Create(Activity activity)
        {
            if (ModelState.IsValid)
            {
                context.Activities.Add(activity);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(activity);
        }