Exemplo n.º 1
0
        public ActionResult Create(Trainer trainer)
        {
            if (ModelState.IsValid)
            {
                db.Trainers.Add(trainer);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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