Beispiel #1
0
        public async Task <CategoriesModel> GetAsync()
        {
            string resultContent;
            HttpResponseMessage httpResponseMessage;
            CategoriesModel     categoriesModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.AllCategories);

            resultContent   = httpResponseMessage.Content.ReadAsStringAsync().Result;
            categoriesModel = JsonConvert.DeserializeObject <CategoriesModel>(resultContent);

            return(categoriesModel);
        }
Beispiel #2
0
        public async Task <ProductsTopViewModel> GetTopViewAsync()
        {
            string resultContent;
            HttpResponseMessage  httpResponseMessage;
            ProductsTopViewModel productsTopViewModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.ProductTopView);

            resultContent        = httpResponseMessage.Content.ReadAsStringAsync().Result;
            productsTopViewModel = JsonConvert.DeserializeObject <ProductsTopViewModel>(resultContent);

            return(productsTopViewModel);
        }
        public async Task <NewsletterModel> GetAsync()
        {
            string resultContent;

            HttpResponseMessage httpResponseMessage;
            NewsletterModel     newsletterModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.Newsletter);

            resultContent   = httpResponseMessage.Content.ReadAsStringAsync().Result;
            newsletterModel = JsonConvert.DeserializeObject <NewsletterModel>(resultContent);

            return(newsletterModel);
        }
        public async Task <BrandsModel> GetAsync()
        {
            string resultContent;
            HttpResponseMessage httpResponseMessage;
            BrandsModel         brandsModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.AllBrands);

            resultContent = httpResponseMessage.Content.ReadAsStringAsync().Result;
            brandsModel   = JsonConvert.DeserializeObject <BrandsModel>(resultContent);
            brandsModel.data.Add(new ObjectBrands {
                productBrandDescription = "ALL BRANDS"
            });

            return(brandsModel);
        }