Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves all seasons data.
        /// </summary>
        /// <returns>All seasons data.</returns>
        public async Task <DataErgastSeasons> GetSeasonsDataAsync()
        {
            try
            {
                HttpResponseMessage response = await _client.GetAsync(_api.Seasons());

                if (response.IsSuccessStatusCode)
                {
                    string content = await response.Content.ReadAsStringAsync();

                    return(JsonConvert.DeserializeObject <DataErgastSeasons>(DataErgast.RemoveMRData(content)));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("\tERROR {0}", ex.Message);
            }

            return(null);
        }