예제 #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);
        }
예제 #2
0
 void Apply(FlightReservationCancelled evt)
 {
     _cancelled = true;
 }
예제 #3
0
        public void On(FlightReservationCancelled cancelled)
        {
            var resv = _reservations.Single(c => c.Localizer == cancelled.Localizer);

            _reservations.Remove(resv);
        }