private void ScheduleToCheckSeatsReservationExpiration(IReadOnlyList <IDomainEvent> reservationEvents) { foreach (var @event in reservationEvents.OfType <SeatsWereReserved>()) { var command = new CheckSeatsReservationExpiration( @event.ClientId, @event.ScreeningId, @event.Seats) { At = @event.At }; _commandScheduler.Schedule(command, ScreeningReservation.ExpirationDelay); } }
private void Handle(CheckSeatsReservationExpiration command) => ScreeningReservationById(command.ScreeningId) .CheckSeatsReservationExpiration(command.ClientId, command.Seats) .AppendEventsTo(_eventStore);