Exemplo n.º 1
0
        public IWeatherInfo Get([FromUri] int cityId_, [FromUri] int serviceId_)
        {
            var service     = WeatherServicesBus.Get().GetWthrServiceItemById(serviceId_);
            var city        = CityServicesBus.Get().GetCityById(cityId_);
            var weatherInfo = service.WeatherService.GetWeather(city);

            weatherInfo.Time = DateTime.Now;
            return(weatherInfo);
        }
Exemplo n.º 2
0
        /// <summary>
        /// ”становить города, доступные пользователю
        /// </summary>
        protected void setCities()
        {
            List <ICity> cityList      = new List <ICity>();
            var          yekaterinburg = new City()
            {
                Id    = 1,
                Name  = "Yekaterinburg",
                Coord = new City.Coordinate
                {
                    Latitude  = 56.8519M,
                    Longitude = 60.6122M
                }
            };
            var madrid = new City()
            {
                Id    = 4,
                Name  = "Madrid",
                Coord = new City.Coordinate
                {
                    Latitude  = 40.41M,
                    Longitude = -3.702M
                }
            };
            var vladivostok = new City()
            {
                Id    = 5,
                Name  = "Vladivostok",
                Coord = new City.Coordinate
                {
                    Latitude  = 43.1056M,
                    Longitude = 131.8735M
                }
            };

            CityServicesBus.Get().AddCity(yekaterinburg);
            CityServicesBus.Get().AddCity(madrid);
            CityServicesBus.Get().AddCity(vladivostok);
        }
Exemplo n.º 3
0
        public List <ICity> Get()
        {
            var cityList = CityServicesBus.Get().GetCities();

            return(cityList);
        }