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)); }
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; }