Ejemplo n.º 1
0
        public async static Task <List <Venue> > GetVenues(double latitude, double longitude)
        {
            List <Venue> venues = new List <Venue>();
            var          la     = latitude.ToString("#.##", System.Globalization.CultureInfo.InvariantCulture);
            var          lo     = longitude.ToString("#.##", System.Globalization.CultureInfo.InvariantCulture);
            var          url    = VenueRoot.GenerateURL(la, lo);

            using (HttpClient client = new HttpClient())
            {
                var response = await client.GetAsync(url);

                var json = await response.Content.ReadAsStringAsync();

                var venueRoot = JsonConvert.DeserializeObject <VenueRoot>(json);

                venues = venueRoot.response.venues as List <Venue>;
            }

            return(venues);
        }
Ejemplo n.º 2
0
        public static async Task <List <Venue> > GetVenues(double latitude, double longitude)
        {
            List <Venue> venues = new List <Venue>();


            var url = VenueRoot.GenerateURL(latitude, longitude);

            using (HttpClient client = new HttpClient())
            {
                var response = await client.GetAsync(url);

                var json = await response.Content.ReadAsStringAsync();

                var venueRoot = JsonConvert.DeserializeObject <VenueRoot>(json);
                venues = venueRoot.response.venues as List <Venue>;
            }


            return(venues);
        }