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