public ActionResult RegisterGuest(Registration registration) { if (ModelState.IsValid) { _registrationRepository.Add(registration); _registrationRepository.Save(); Response.Cookies.Append("registered"+registration.MeetingId, "true"); } return RedirectToAction("Detail", registration.MeetingId); }
public async Task<ActionResult> Register(int meetingId) { var user = await _userManager.FindByIdAsync(User.GetUserId()); var registration = new Registration { MeetingId = meetingId, UserId = user.Id, Name = user.Name, Email = user.Email }; _registrationRepository.Add(registration); _registrationRepository.Save(); return RedirectToAction("Detail", new {id = meetingId}); }