コード例 #1
0
        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");
        }
コード例 #2
0
        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();
            }
        }