コード例 #1
0
ファイル: FeatureResource.cs プロジェクト: tukzar/BreweryDB
        public async Task <ResponseContainer <T> > Get(DateTime date)
        {
            string week = date.Month.ToString();

            if (week.Length == 1)
            {
                week = $"0{week}";
            }

            var year = date.Year;

            var url = $"{BreweryDbClient.BaseAddress}feature/{year}-{week}?key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <T> >(url));
        }
コード例 #2
0
ファイル: BeerResource.cs プロジェクト: tukzar/BreweryDB
        public async Task <ResponseContainer <List <T> > > Get(NameValueCollection nvc)
        {
            var parameterBuilder = new StringBuilder();

            foreach (var parameter in nvc)
            {
                parameterBuilder.Append(parameter.Key);
                parameterBuilder.Append("=");
                parameterBuilder.Append(parameter.Value);
                parameterBuilder.Append("&");
            }

            var url = $"{BreweryDbClient.BaseAddress}beers?{parameterBuilder}key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <List <T> > >(url));
        }
コード例 #3
0
ファイル: FeatureResource.cs プロジェクト: tukzar/BreweryDB
        public async Task <ResponseContainer <List <T> > > GetAll(int pageNumber)
        {
            var url = $"{BreweryDbClient.BaseAddress}features?p={pageNumber}&key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <List <T> > >(url));
        }
コード例 #4
0
ファイル: FeatureResource.cs プロジェクト: tukzar/BreweryDB
        public async Task <ResponseContainer <T> > ThisWeeks()
        {
            var url = $"{BreweryDbClient.BaseAddress}featured?key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <T> >(url));
        }
コード例 #5
0
        public async Task <ResponseContainer <T> > Get(string id)
        {
            var url = $"{BreweryDbClient.BaseAddress}adjunct/{id}?key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <T> >(url));
        }
コード例 #6
0
ファイル: BeerResource.cs プロジェクト: tukzar/BreweryDB
        public async Task <ResponseContainer <List <T> > > Search(string keyword)
        {
            var url = $"{BreweryDbClient.BaseAddress}search?q={keyword}&type=beer&withBreweries=y&withSocialAccounts=y&withGuilds=y&withLocations=y&withAlternateNames=y&hasLabels=y&withIngredients=y&key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <List <T> > >(url));
        }
コード例 #7
0
        public async Task <ResponseContainer <List <T> > > GetAll()
        {
            var url = $"{BreweryDbClient.BaseAddress}socialsites?key={BreweryDbClient.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <List <T> > >(url));
        }
コード例 #8
0
        public async Task <ResponseContainer <List <T> > > GetBeerListWithFilter(string filterStr)
        {
            var url = $"{BreweryDbAPICall.BaseAddress}beers?{filterStr}&key={BreweryDbAPICall.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <List <T> > >(url));
        }
コード例 #9
0
        public async Task <ResponseContainer <T> > Get(string id)
        {
            var url = $"{BreweryDbAPICall.BaseAddress}beer/{id}?withBreweries=y&key={BreweryDbAPICall.ApplicationKey}&format=json";

            return(await JsonDownloader.DownloadSerializedJsonDataAsync <ResponseContainer <T> >(url));
        }