コード例 #1
0
        public WeatherService(IInternalConfig config, IHttpClientFactory factory, IMemoryCache cache)
        {
            _config = config;
            if (string.IsNullOrWhiteSpace(_config.OpenWeatherServiceToken))
            {
                throw new ArgumentNullException(nameof(IInternalConfig.OpenWeatherServiceToken));
            }

            _cache              = cache ?? throw new ArgumentNullException(nameof(cache));
            _client             = factory.CreateClient();
            _client.BaseAddress = new Uri("http://api.openweathermap.org");
        }
コード例 #2
0
 public Transfer(IInternalConfig internalConfig)
 {
     source      = internalConfig.GetFileConnection("source");
     destination = internalConfig.GetFileConnection("destination");
 }