コード例 #1
0
ファイル: EventsController.cs プロジェクト: kels2000/projects
        /// <summary>
        /// Adds a team memeber's name to the list of ticket claims for a particular event
        /// </summary>
        /// <param name="loginName">the loginname of the individual who has raised their hand</param>
        /// <param name="eventName">the name of the event</param>
        /// <param name="eventId">the id of the event that the individual is interested in</param>
        public void InterestedInEvent(string loginName, string eventName, int eventId)
        {
            SelectUserQuery userQuery = new SelectUserQuery(new CurrentUser()
            {
                LoginName = loginName
            });
            CurrentUser user = commandBus.ProcessQuery(userQuery);

            TicketClaims claim = new TicketClaims(
                ticketClaimsId: 0,
                eventName: eventName,
                eventId: eventId,
                firstName: user.FirstName,
                lastName: user.LastName,
                eMailAddress: user.EmailAddress,
                userName: loginName);

            InsertTicketClaim command = new InsertTicketClaim(claim);

            commandBus.Execute(command);
        }
コード例 #2
0
 public void HandleCommand(InsertTicketClaim command)
 {
     ticketClaimsRepository.InsertTicketClaim(command.TicketClaim);
 }