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