public WeatherForecast(OpenWeatherMapClientFactory openWeatherMapClientFactory, WeatherForcastRequestConfig requestConfig) { this._openWeatherMapClientFactory = openWeatherMapClientFactory; _weatherForecastUriBuilder = new WeatherForecastUriBuilder(requestConfig); }
public WeatherForecastUriBuilder(WeatherForcastRequestConfig forcastInput) { this._forcastInput = forcastInput; }
public static void AddOpenWeatherMapService(this IServiceCollection services, WeatherForcastRequestConfig baseInput) { services.AddHttpClient <OpenWeatherForecastClient>(); services.AddSingleton <OpenWeatherMapClientFactory>(); services.AddSingleton <WeatherForcastRequestConfig>(x => baseInput); services.AddScoped <IWeatherForecast, WeatherForecast>(); }