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

            return View(race);
        }