Esempio n. 1
0
 /// <summary>
 /// Get forecast by city or zipcode based on isCity true or false
 /// </summary>
 /// <param name="inputValue"></param>
 /// <param name="isCity"></param>
 /// <returns></returns>
 public List <WeatherEntity> GetForecast(string inputValue, bool isCity)
 {
     try
     {
         var parser   = new WeatherParserResponse();
         var response = new WeatherForecast();
         response = isCity ? apiClient.GetForecastByCity(inputValue) : apiClient.GetForecastByZipCode(inputValue);
         var weatherList = parser.GetWeatherData(response, inputValue, isCity);
         return(weatherList);
     }
     catch (Exception)
     {
         throw;
     }
 }