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