Beispiel #1
0
        public static EFCoreApp2020E.Flight ConvertToFlightEF(this Models.Flight f)
        {
            var refFlight = new EFCoreApp2020E.Flight();

            refFlight.FlightNo    = f.FlightNo;
            refFlight.Seats       = f.Seats;
            refFlight.Date        = f.Date;
            refFlight.Departure   = f.Departure;
            refFlight.Destination = f.Destination;

            return(refFlight);
        }
Beispiel #2
0
        public static Models.Flight ConvertToFlightM(this EFCoreApp2020E.Flight f)
        {
            Models.Flight fM = new Models.Flight();

            fM.FlightNo    = f.FlightNo;
            fM.Date        = f.Date;
            fM.Departure   = f.Departure;
            fM.Destination = f.Destination;

            /**
             * @TODO  Remove ?
             **/
            fM.Seats          = f.Seats;
            fM.AvailableSeats = (short)(f.Seats - f.BookingSet.Count);
            fM.SeatPrice      = f.BasePrice;

            return(fM);
        }