Esempio n. 1
0
        public async Task <ObservableCollection <CatalogItem> > GetCatalogAsync()
        {
            CatalogRoot catalog = await catalogApi.GetCatalogAsync();

            if (catalog?.Data != null)
            {
                return(new ObservableCollection <CatalogItem>(catalog.Data));
            }
            else
            {
                return(new ObservableCollection <CatalogItem>());
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> OnGetAsync(string categoryName)
        {
            var productList = await _catalogApi.GetCatalogAsync();

            CategoryList = productList.Select(r => r.Category).Distinct();

            if (!string.IsNullOrWhiteSpace(categoryName))
            {
                ProductList      = productList.Where(p => p.Category == categoryName);
                SelectedCategory = categoryName;
            }
            else
            {
                ProductList = productList;
            }

            return(Page());
        }
Esempio n. 3
0
        public async Task <IActionResult> OnGetAsync()
        {
            ProductList = await _catalogApi.GetCatalogAsync();

            return(Page());
        }