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