public OpenWeatherMapServiceProvider( HttpClient client, IOptions <OpenWeatherMapSettings> openWeatherMapSettings) { _httpClient = client; _openWeatherMapSettings = openWeatherMapSettings.Value; }
public OpenWeatherMapService(IOptions <OpenWeatherMapSettings> openWeatherMapOptions) { this._openWeatherMapSettings = openWeatherMapOptions.Value; this._httpClient = new HttpClient { BaseAddress = new Uri(this._openWeatherMapSettings.ApiEndpoint), Timeout = TimeSpan.FromSeconds(45) }; }
public WeatherNowController(IWeatherClient <string> weatherClient, ILogger <WeatherNowController> logger, IConfiguration config, IOptions <OpenWeatherMapSettings> openWeatherSettingsAccessor, IMapper mapper) { _weatherClient = weatherClient; _logger = logger; _configuration = config; _openWeatherSettings = openWeatherSettingsAccessor.Value; _mapper = mapper; }