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

            return View(race);
        }