Example #1
0
        public FlightViewModel Create(FlightPostModel model)
        {
            var flight  = _mapper.Map <FlightModel>(model);
            var created = _airportFlightsService.Create(flight);
            var result  = _mapper.Map <FlightViewModel>(created);

            return(result);
        }
Example #2
0
        static void Main(string[] args)
        {
            var controllerf = new FlightsController();

            var flight = new FlightPostModel()
            {
                FlightCity = "Kiev - New-York",
                FlightTime = DateTime.Now,
                Pilot      = new PilotPostModel()
                {
                    FirstName = "Igor",
                    LastName  = "Ivanov",
                }, Plane = new PlanePostModel()
                {
                    ModelOfPlane      = "Boeing 737",
                    PassengerCapacity = 180
                }
            };

            var flightcreate = controllerf.Create(flight);
        }
Example #3
0
        static void Main(string[] args)
        {
            var controllerf = new FlightsController();

            var flight = new FlightPostModel()
            {
                FlightCity = "Kiev - New-York",
                FlightTime = DateTime.Now,
                //Pilots = new List<PilotPostModel>()
                //{
                //    new PilotPostModel
                //    {
                //        FirstName = "Aslan",
                //        LastName = "Saber"
                //    }
                //}, Plane = new PlanePostModel()
                //{
                //    ModelOfPlane = "Boeing 737",
                //    PassengerCapacity = 180
                //}
            };

            var flightcreate = controllerf.Create(flight);
        }