public IWeatherData GetWeatherData(IToponymData toponym)
        {
            var request  = new ForecastIORequest(_apiKey, (float)toponym.Latitude, (float)toponym.Longitude, Unit.si);
            var response = request.Get();

            return(new ForecastWeatherData(response));
        }
Beispiel #2
0
        public IWeatherData GetWeatherData(IToponymData toponym)
        {
            var data = _repository.GetWeatherDataByLatLong(_apiKey,
                                                           toponym.Latitude.ToString("F2").Replace(',', '.'),
                                                           toponym.Longitude.ToString("F2").Replace(',', '.'));

            if (data == null)
            {
                throw new NotFoundWeatherDataException();
            }

            return(new ApixuWeatherData(data));
        }
        public IWeatherData GetWeatherData(IToponymData toponym)
        {
            var data = _repository.GetWeatherDataByLatLong(_apiKey,
                toponym.Latitude.ToString("F2").Replace(',', '.'),
                toponym.Longitude.ToString("F2").Replace(',', '.'));

            if (data == null)
            {
                throw new NotFoundWeatherDataException();
            }

            return new ApixuWeatherData(data);
        }
 public IWeatherData GetWeatherData(IToponymData Toponym)
 {
     return new FakeWeatherData(_random);
 }
Beispiel #5
0
 public CityWeatherInfo(IToponymData toponym, IWeatherFromProviderInfo[] weatherFromProvider)
 {
     Toponym             = toponym;
     WeatherFromProvider = weatherFromProvider;
 }
 public CityWeatherInfo(IToponymData toponym, IWeatherFromProviderInfo[] weatherFromProvider)
 {
     Toponym = toponym;
     WeatherFromProvider = weatherFromProvider;
 }
 public IWeatherData GetWeatherData(IToponymData toponym)
 {
     var request = new ForecastIORequest(_apiKey, (float)toponym.Latitude, (float)toponym.Longitude, Unit.si);
     var response = request.Get();
     return new ForecastWeatherData(response);
 }
Beispiel #8
0
 public IWeatherData GetWeatherData(IToponymData Toponym)
 {
     return(new FakeWeatherData(_random));
 }