コード例 #1
0
        public JsonResult GetAircrafts()
        {
            var aircrafts = _aircraftService.GetProviderAircrafts();

            return(new JsonResult(aircrafts.Select(aircraft => new
            {
                aircraftId = aircraft.Id,
                modelName = aircraft.Model.Name,
                typeName = aircraft.Type.Name,
                aircraft.TailNumber,
                HomebaseName = aircraft.HomeBase.Name,
                aircraft.ArgusSafetyRating,
                aircraft.WyvernSafetyRating,
                aircraft.ManufactureYear,
                aircraft.LastExtRefurbish,
                aircraft.LastIntRefurbish,
                aircraft.MaxPassengers,
                aircraft.HoursFlown,
                aircraft.Range,
                aircraft.Speed,
                aircraft.CargoCapability,
                aircraft.WiFi,
                aircraft.BookableDemo,
                aircraft.NumberOfTelevision,
                images = aircraft.Images.OrderBy(img => img.Order)
                         .Select(img => new
                {
                    img.Name,
                    img.Order,
                    img.FileName
                })
            })
                                  .ToList()));
        }