public WeatherService(
     IGlobalWeatherService globalWeatherService,
     IOpenWeatherMapService openWeatherMapService)
 {
     _globalWeatherService  = globalWeatherService;
     _openWeatherMapService = openWeatherMapService;
 }
예제 #2
0
        public WeatherProvider(
            ILogger <WeatherProvider> logger,
            ILocationProvider locationProvider,
            ICacheRepository <WeatherConditions> cacheRepository,
            IForecastService forecastService,
            IOpenWeatherMapService openWeatherMapService,
            IYahooWeatherService yahooWeatherService)
            : base(logger, cacheRepository)
        {
            try
            {
                var location = locationProvider.Execute().Result;
                if (location == null)
                {
                    _logger.LogError($"{GetType().Name}: Cannot get Location. Weather will disabled.");
                }
                else
                {
                    _serializedLocation = JsonConvert.SerializeObject(location);

                    _operations.Add(yahooWeatherService);
                    _operations.Add(openWeatherMapService);
                    _operations.Add(forecastService);
                }
            }
            catch (Exception e)
            {
                _logger.LogError("WeatherProvider", e);
                throw e;
            }
        }
예제 #3
0
 public OpenWeatherMapService()
 {
     this.owms = RestService.For <IOpenWeatherMapService>(
         new HttpClient()
     {
         BaseAddress = new Uri(@"https://api.openweathermap.org/data/2.5")
     },
         new RefitSettings
     {
         JsonSerializerSettings = Utilities.JsonSettingsUtility.GetSnakeCaseJsonSerializerSettings()
     }
         );
 }
예제 #4
0
 public TemperatureController(ICityTemperatureRepository cityTempRepository, IOpenWeatherMapService openWeatherMapService)
 {
     _cityTempRepository    = cityTempRepository;
     _openWeatherMapService = openWeatherMapService;
 }
 public TemperaturaRepositorio(DataContext contexto, IOpenWeatherMapService servico)
 {
     _contexto = contexto;
     _contexto.Database.EnsureCreated();
     _servico = servico;
 }
 public GetSpellsForLocationActionHandler(IOpenWeatherMapService openWeatherMap, IMapper <CurrentWeather, CurrentWeatherRequestDto, CurrentWeatherRequestDto> weatherMapper, ISpellRepository context)
 {
     OpenWeatherMap = openWeatherMap;
     WeatherMapper  = weatherMapper;
     Context        = context;
 }
예제 #7
0
 public WeatherController(IOpenWeatherMapService openWeatherMapService)
 {
     _openWeatherMapService = openWeatherMapService;
 }
예제 #8
0
 public WeatherController()
 {
     _openWeatherMapService = new OpenWeatherMapService();
 }
예제 #9
0
 public EnvironmentController(IConfiguration configuration, IDataLogService dataLogService, IOpenWeatherMapService openWeatherMapService)
 {
     _dataLogService        = dataLogService;
     _openWeatherMapService = openWeatherMapService;
     _configuration         = configuration;
 }
예제 #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="weatherMapService"></param>
 /// <param name="dataService"></param>
 public WeatherFunction(IOpenWeatherMapService weatherMapService, IDataService dataService)
 {
     _weatherMapService = weatherMapService;
     _dataService       = dataService;
 }
예제 #11
0
 public HomeController(IOpenWeatherMapService openWeatherMapService, IWeatherInfoGenerator weatherInfoGenerator, ICSVReader cSVReader)
 {
     _openWeatherMapService = openWeatherMapService;
     _weatherInfoGenerator  = weatherInfoGenerator;
     _csvReader             = cSVReader;
 }
 public GetCurrentWeatherActionHandler(IOpenWeatherMapService openWeatherMap,
                                       IMapper <CurrentWeather, CurrentWeatherRequestDto, CurrentWeatherRequestDto> mapper)
 {
     OpenWeatherMap = openWeatherMap;
     Mapper         = mapper;
 }