public ActionResult UpdateRsvpForm(GuestResponse updateGuestResponse) { this.dbContext.GuestResponses.Attach(updateGuestResponse); this.dbContext.Entry(updateGuestResponse).State = System.Data.Entity.EntityState.Modified; this.dbContext.SaveChanges(); return RedirectToAction("ViewAllGuests"); }
public ViewResult RsvpForm(GuestResponse guestResponse) { if (ModelState.IsValid) { dbContext.GuestResponses.Add(guestResponse); dbContext.SaveChanges(); // TODO: Email response to the party organizer return View("Thanks", guestResponse); } else { // there is a validation error return View(); } }