public ActionResult Create(Event @event) { if (ModelState.IsValid) { @event.ApplicationUserId = User.Identity.GetUserId(); db.Events.Add(@event); db.SaveChanges(); return RedirectToAction("Index"); } return View(@event); }
public ActionResult Edit(Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(@event); }