public WeatherHttpClient(System.Net.Http.HttpClient httpClient, IWeatherSettings settings) { _httpClient = httpClient; _settings = settings; _httpClient.BaseAddress = new Uri(settings.GetBaseUrl()); }
public WeatherService(IWeatherSettings settings) { _Settings = settings; _WeatherCurrentUri = string.Format("http://api.openweathermap.org/data/2.5/weather?zip={0},{1}&units=metric&appId={2}&lang={3}", _Settings.ZipCode, _Settings.Country, _Settings.ApiKey, CultureInfo.CurrentCulture.TwoLetterISOLanguageName); _WeatherForecastUri = string.Format("http://api.openweathermap.org/data/2.5/forecast?zip={0},{1}&units=metric&appId={2}&lang={3}", _Settings.ZipCode, _Settings.Country, _Settings.ApiKey, CultureInfo.CurrentCulture.TwoLetterISOLanguageName); _WeatherForecasts = new List <WeatherMetrics>(); }
public WeatherDataUpdater(IWeatherSettings settings, IWeatherStorage weatherStorage, IWeatherHttpClient httpClient) { this._settings = settings; _weatherStorage = weatherStorage; _httpClient = httpClient; }