Beispiel #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()));
        }
Beispiel #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);
        }
Beispiel #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);
        }