コード例 #1
0
 public Location amadeusLocationToLocation(AmadeusLocation aml)
 {
     return(new Location
     {
         Code = aml.Code,
         City = aml.City,
         Img = aml.Img
     });
 }
コード例 #2
0
 public LocationDTO(AmadeusLocation location)
 {
     IataCode     = location.IataCode;
     Type         = location.LocationType;
     Name         = location.Name;
     DetailedName = location.DetailedName;
     CityName     = location.Address?.CityName ?? "Unknown";
     CountryName  = location.Address?.CountryName ?? "Unknown";
 }
コード例 #3
0
        public LocationData()
        {
            this.locations = new List <AmadeusLocation>();
            JArray json_loc = JArray.Parse(File.ReadAllText("locations.json"));

            foreach (dynamic dyn_loc in json_loc)
            {
                AmadeusLocation loc = new AmadeusLocation(dyn_loc);
                this.locations.Add(loc);
            }
        }