BeerDrinkin.Core.ViewModels.TrendingBeersViewModel.FetchTrendingBeers C# (CSharp) Method

FetchTrendingBeers() public method

public FetchTrendingBeers ( int takeCount = 10 ) : Task>
takeCount int
return Task>
        public async Task<List<Beer>> FetchTrendingBeers(int takeCount = 10)
        {
            var stopWatch = new System.Diagnostics.Stopwatch();
            stopWatch.Start();

            List<Beer> results;
            if (Utils.Helpers.Settings.LocationEnabled == false)
            {
                results = await trendsService.TrendingBeers(takeCount, 0, 0);
            }
            else
            {
                var position = await Plugin.Geolocator.CrossGeolocator.Current.GetPositionAsync();
                results = await trendsService.TrendingBeers(takeCount, position.Longitude, position.Latitude);
            }

            stopWatch.Stop();

            return results;
        }
    }