Exemplo n.º 1
0
        public async Task HandleAsync(AddSeatTypeCommand command)
        {
            var conference = await _conferenceRepository.GetConference(command.AggregateRootId);

            List <SeatType> seatTypeList = new List <SeatType>();
            var             seatType     = new SeatType("舒适型", 60, 20, command.AggregateRootId);
            var             seatType1    = new SeatType("豪华型", 80, 10, command.AggregateRootId);

            seatTypeList.Add(seatType);
            seatTypeList.Add(seatType1);
            conference.AddSeatType(seatTypeList);
            await _conferenceRepository.ModifyConference(conference);

            await _conferenceRepository.CommitAsync();

            //await _publishDomainEvent.PublishEventAsync(conference);
        }
Exemplo n.º 2
0
 public async Task AddSeatType(Guid conferenceId)
 {
     var addSeatTypeCommand = new AddSeatTypeCommand(conferenceId);
     await _commandService.SendCommandAsync(addSeatTypeCommand);
 }