Example #1
0
        public FlightReservationCancelled Cancel(CancelFlightReservation cmd)
        {
            if (_cancelled)
            {
                throw new InvalidOperationException("Reservation already cancelled");
            }
            var evt = new FlightReservationCancelled
            {
                Localizer = cmd.Localizer
            };

            Apply(evt);
            return(evt);
        }
Example #2
0
 void Apply(FlightReservationCancelled evt)
 {
     _cancelled = true;
 }
Example #3
0
        public void On(FlightReservationCancelled cancelled)
        {
            var resv = _reservations.Single(c => c.Localizer == cancelled.Localizer);

            _reservations.Remove(resv);
        }