コード例 #1
0
        public async Task UpdateSeat( SeatType seat)
        {
            if (!await _seatRepository.CheckExistenceById(seat.Id))
                throw new ApplicationException("Seat record wasn't found!");

            await _seatRepository.UpdateSeat(seat);
            var conference = await _conferenceRepository.Get(seat.ConferenceId);
            // Don't publish seat updates if the conference was never published 
            // (and therefore is not published either).
            if (conference.WasEverPublished)
                _hostServiceBus.Publish<ISeatUpdated>(new SeatUpdated(seat));

        }
コード例 #2
0
 public SeatUpdated(SeatType seat) {
     CorrelationId = seat.ConferenceId;
     Name = seat.Name;
     Description = seat.Description;
     Price = seat.Price;
     Quantity = seat.Quantity;
     Id = seat.Id;
     TimeStamp = DateTimeOffset.UtcNow;
     Version = 1;
 }