Exemple #1
0
        public List <BarData> GetBarsAround(string latitude, string longitude, string radius)
        {
            RegexTools.LocationDataTextIsCorrect(latitude, longitude, radius);
            var venueList = GetBarData(latitude, longitude, radius);
            var barList   = VenueListToBarList(venueList, radius);

            return(barList);
        }
Exemple #2
0
        public async Task <List <BarData> > GetBarsAroundAsync(string latitude, string longitude, string radius)
        {
            RegexTools.LocationDataTextIsCorrect(latitude, longitude, radius);
            var venueList = await GetBarDataAsync(latitude, longitude, radius);

            var barList = VenueListToBarList(venueList, radius);

            return(barList);
        }
        private async Task <List <Place> > GetBarDataAsync(string latitude, string longitude, string radius)
        {
            RegexTools.LocationDataTextIsCorrect(latitude, longitude, radius);
            var link       = string.Format(_apiLink, _accessToken, latitude, longitude, radius, _requestedFields, _category);
            var jsonStream = await _fetcher.GetHttpStreamAsync(link);

            var barList = JsonConvert.DeserializeObject <PlacesResponse>(jsonStream).data;

            return(barList);
        }