예제 #1
0
        public ActionResult System(string id)
        {
            var svc = new BikeShareReadService();
            var stations = from s in svc.GetStations(id)
                           select JsonStation.FromStation(s);

            return Json(stations.ToArray(), JsonRequestBehavior.AllowGet);
        }
예제 #2
0
        public ActionResult Near(string id, double latitude, double longitude, int radius)
        {
            var svc = new BikeShareReadService();
            var stations = from s in svc.GetStations(id)
                           let dist = (int)CalculateDistance(latitude, longitude, s.Latitude, s.Longitude)
                           where dist < radius
                           select JsonStation.FromStation(s, dist);

            return Json(stations.ToArray(), JsonRequestBehavior.AllowGet);
        }
예제 #3
0
        public ActionResult System(string id)
        {
            var svc = new BikeShareReadService();
            var stations = svc.GetStations(id).ToArray();

            dynamic model = new ExpandoObject();
            model.Stations = stations;

            return View(model);
        }