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