/// <summary> /// Gets all seasons a driver has participated. /// </summary> /// <param name="driver">Driver ID.</param> /// <returns>Season info.</returns> public async Task <SeasonTable> GetSeasonsByDriverAsync(string driver) { try { HttpResponseMessage response = await _client.GetAsync(_api.SeasonsByDriver(driver)); if (response.IsSuccessStatusCode) { string content = await response.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <DataErgastSeasons>(DataErgast.RemoveMRData(content))?.SeasonTable); } } catch (Exception ex) { Debug.WriteLine("\tERROR {0}", ex.Message); } return(null); }