public static Flight ToModel(this FlightAddedEvent @event) { return(new Flight { Aircraft = @event.Aircraft, Number = @event.Number, Price = @event.Price, ArriveDate = @event.ArriveDate, ArriveStation = @event.ArriveStation, DepartureDate = @event.DepartureDate, DepartureStation = @event.DepartureStation, FlightKey = @event.FlightKey }); }
protected virtual void OnFlightAddedEvent(FlightAddedEventArg e) { FlightAddedEvent?.Invoke(this, e); }
public void Apply(FlightAddedEvent aggregateEvent) { _flights.Add(aggregateEvent.ToModel()); }