public void Execute(ReplyDTO replyDto) { var invitation = _invitationRepository.GetById(replyDto.Id); var @event = _eventRespository.GetById(invitation.EventId); invitation.Reply(replyDto.Answer); if (invitation.InvitationStatus == InvitationStatus.Accepted) { _eventContext.Add(_participantFactory.CreateParticipant(invitation.EventId, new ContactInformation { Email = replyDto.Email, FirstName = replyDto.FirstName, LastName = replyDto.LastName })); } _eventContext.Update(invitation); _eventContext.SaveChanges(); }
public IEvent Execute(Guid id) { return(_eventRepository.GetById(id)); }