コード例 #1
0
 public void BuildProfile(JObject result)
 {
     Profile = new SpecieModel
     {
         Name            = result.SelectToken("name").ToString(),
         Classification  = result.SelectToken("classification").ToString(),
         Designation     = result.SelectToken("designation").ToString(),
         AverageHeight   = result.SelectToken("average_height").ToString(),
         SkinColors      = result.SelectToken("skin_colors").ToString(),
         HairColors      = result.SelectToken("hair_colors").ToString(),
         EyeColors       = result.SelectToken("eye_colors").ToString(),
         AverageLifeSpan = result.SelectToken("average_lifespan").ToString(),
         HomeWorld       = MakeRequest.GetSpecificData(result.SelectToken("homeworld").ToString()).SelectToken("name").ToString(),
         Language        = result.SelectToken("language").ToString(),
         People          = GetNames.Get("people", result),
         Films           = GetNames.Get("films", result),
         Url             = result.SelectToken("url").ToObject <Uri>()
     };
 }
コード例 #2
0
 public void BuildProfile(JObject result)
 {
     Profile = new VehicleModel
     {
         Name                 = result.SelectToken("name").ToString(),
         Model                = result.SelectToken("model").ToString(),
         Manufacturer         = result.SelectToken("manufacturer").ToString(),
         CostInCredits        = result.SelectToken("cost_in_credits").ToString(),
         Length               = result.SelectToken("length").ToString(),
         MaxAtmospheringSpeed = result.SelectToken("max_atmosphering_speed").ToString(),
         Crew                 = result.SelectToken("crew").ToString(),
         Passengers           = result.SelectToken("passengers").ToString(),
         CargoCapacity        = result.SelectToken("cargo_capacity").ToString(),
         Consumables          = result.SelectToken("consumables").ToString(),
         VehicleClass         = result.SelectToken("vehicle_class").ToString(),
         Pilots               = GetNames.Get("pilots", result),
         Films                = GetNames.Get("films", result),
         Url = result.SelectToken("url").ToObject <Uri>()
     };
 }
コード例 #3
0
        public FilmModel BuildProfile(JObject result)
        {
            Profile = new FilmModel
            {
                Title        = result.SelectToken("title").ToString(),
                EpisodeId    = result.SelectToken("episode_id").ToString(),
                OpeningCrawl = result.SelectToken("opening_crawl").ToString(),
                Director     = result.SelectToken("director").ToString(),
                Producer     = result.SelectToken("producer").ToString(),
                ReleaseDate  = result.SelectToken("release_date").ToString(),
                Characters   = GetNames.Get("characters", result),
                Planets      = GetNames.Get("planets", result),
                StarShips    = GetNames.Get("starships", result),
                Vehicles     = GetNames.Get("vehicles", result),
                Species      = GetNames.Get("species", result),
                Url          = result.SelectToken("url").ToObject <Uri>()
            };

            return(Profile);
        }
コード例 #4
0
 public void BuildProfile(JObject result)
 {
     Profile = new CharacterModel
     {
         Name      = result.SelectToken("name").ToString(),
         Height    = result.SelectToken("height").ToString(),
         Gender    = result.SelectToken("gender").ToString(),
         Mass      = result.SelectToken("mass").ToString(),
         BirthYear = result.SelectToken("birth_year").ToString(),
         EyeColor  = result.SelectToken("eye_color").ToString(),
         SkinColor = result.SelectToken("skin_color").ToString(),
         Films     = GetNames.Get("films", result),
         Species   = GetNames.Get("species", result).FirstOrDefault(),
         HairColor = result.SelectToken("hair_color").ToString(),
         HomeWorld = MakeRequest.GetSpecificData(result.SelectToken("homeworld").ToString()).SelectToken("name").ToString(),
         Vehicles  = GetNames.Get("vehicles", result),
         StarShips = GetNames.Get("starships", result),
         Url       = result.SelectToken("url").ToObject <Uri>()
     };
 }
コード例 #5
0
        public PlanetModel BuildProfile(JObject result)
        {
            Profile = new PlanetModel
            {
                Name           = result.SelectToken("name").ToString(),
                RotationPeriod = result.SelectToken("rotation_period").ToString(),
                OrbitalPeriod  = result.SelectToken("orbital_period").ToString(),
                Diameter       = result.SelectToken("diameter").ToString(),
                Climate        = result.SelectToken("climate").ToString(),
                Gravity        = result.SelectToken("gravity").ToString(),
                Terrain        = result.SelectToken("terrain").ToString(),
                Films          = GetNames.Get("films", result),
                SurfaceWater   = result.SelectToken("surface_water").ToString(),
                Population     = result.SelectToken("population").ToString(),
                Residents      = GetNames.Get("residents", result),
                Url            = result.SelectToken("url").ToObject <Uri>()
            };

            return(Profile);
        }
コード例 #6
0
 public void BuildProfile(JObject result)
 {
     Profile = new StarShipModel
     {
         Name                 = result.SelectToken("name").ToString(),
         Model                = result.SelectToken("model").ToString(),
         Manufacturer         = result.SelectToken("manufacturer").ToString(),
         CostInCredits        = result.SelectToken("cost_in_credits").ToString(),
         Length               = result.SelectToken("length").ToString(),
         MaxAtmospheringSpeed = result.SelectToken("max_atmosphering_speed").ToString(),
         Crew                 = result.SelectToken("crew").ToString(),
         Passengers           = result.SelectToken("passengers").ToString(),
         CargoCapacity        = result.SelectToken("cargo_capacity").ToString(),
         Consumables          = result.SelectToken("consumables").ToString(),
         HyperdriveRating     = result.SelectToken("hyperdrive_rating").ToString(),
         Mglt                 = result.SelectToken("MGLT").ToString(),
         StarShipClass        = result.SelectToken("starship_class").ToString(),
         Pilots               = GetNames.Get("pilots", result),
         Films                = GetNames.Get("films", result),
         Url = result.SelectToken("url").ToObject <Uri>()
     };
 }