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