Example #1
0
        /// <summary>
        /// Gets constructor list.
        /// </summary>
        /// <returns>Constructors info.</returns>
        public async Task <ConstructorTable> GetConstructorsAsync()
        {
            try
            {
                HttpResponseMessage response = await _client.GetAsync(_api.Constructors());

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

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

            return(null);
        }