Ejemplo n.º 1
0
        public static async Task <Team> GetTeam(int teamId)
        {
            var endpoint = $"https://free-nba.p.rapidapi.com/teams/{teamId}";

            var content = await BuildRequests.Build(endpoint);

            return(JsonConvert.DeserializeObject <Team>(content.ToString()));
        }
Ejemplo n.º 2
0
        public static async Task <AllMatchesResponse> GetAllMatches(int page, int per_page)
        {
            var endpoint = $"https://free-nba.p.rapidapi.com/games?Seasons=2018%2C2017&page={page}&per_page={per_page}";
            var content  = await BuildRequests.Build(endpoint);

            var jObj = JsonConvert.DeserializeObject <AllMatchesResponse>(content.ToString());

            return(jObj);
        }
Ejemplo n.º 3
0
        private static async Task <AllPlayersResponse> GetAllPlayers(int page, int per_page)
        {
            var endpoint = $"https://free-nba.p.rapidapi.com/players?page={page}&per_page={per_page}";

            var content = await BuildRequests.Build(endpoint);

            var player = JsonConvert.DeserializeObject <AllPlayersResponse>(content.ToString());

            //List<Player> orderedPlayers = player.Data.OrderBy(x => x.Height_feet + x.Height_inches).ToList();
            //return new AllPlayersResponse { Data = orderedPlayers, Meta = player.Meta };
            return(player);
        }