public ActionResult RemoveParticipant(RemoveParticipantFromRetreatViewModel viewModel)
 {
     var result = _commandInvoker.Invoke(viewModel,
                                         typeof(RemoveParticipantFromRetreatCommand),
                                         () => this.RedirectToAction(c => c.Index(viewModel.RetreatId)),
                                         () => this.RedirectToAction(c => c.Index(viewModel.RetreatId)),
                                         ModelState);
     return result;
 }
        public ActionResult RemoveParticipant(int retreatId, int participantId)
        {
            var retreat = _retreatRepository.GetById(retreatId);
            if (retreat == null)
            {
                return this.RedirectToAction(c => c.Index(retreatId));
            }

            var participant = (from registration in retreat.Registrations
                               where registration.Participant.Id == participantId
                               select registration.Participant).SingleOrDefault();
            if (participant == null)
            {
                return this.RedirectToAction(c => c.Index(retreatId));
            }

            var viewModel = new RemoveParticipantFromRetreatViewModel
            {
                RetreatId = retreatId,
                ParticipantId = participantId,
                RetreatDate = retreat.StartDate,
                FirstName = participant.FirstName,
                LastName = participant.LastName,
            };

            return View(viewModel);
        }