public FlightReservationCancelled Cancel(CancelFlightReservation cmd) { if (_cancelled) { throw new InvalidOperationException("Reservation already cancelled"); } var evt = new FlightReservationCancelled { Localizer = cmd.Localizer }; Apply(evt); return(evt); }
void Apply(FlightReservationCancelled evt) { _cancelled = true; }
public void On(FlightReservationCancelled cancelled) { var resv = _reservations.Single(c => c.Localizer == cancelled.Localizer); _reservations.Remove(resv); }