/// <summary> /// Init new instance /// </summary> /// <param name="client">Http client</param> /// <param name="config">Configuration</param> /// <exception cref="ArgumentNullException">Throws exception if config is null</exception> public OpenWeatherDatabase(HttpClient client, IOpenWeatherConfig config) { if (config is null) { throw new ArgumentNullException(nameof(config)); } Weather = new WeatherRepository(new WeatherClient(client, config.ApiKey)); Forecast = new ForecastRepository(new ForecastClient(client, config.ApiKey)); }
public OpenWeatherProvider(IWeatherHttpClient httpClient, IOpenWeatherConfig config) { _httpClient = httpClient; _config = config; }