Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(string categoryName)
        {
            if (!string.IsNullOrEmpty(categoryName))
            {
                ProductList = await _catalogApi.GetProductByCategory(categoryName);

                SelectedCategory = categoryName;
            }
            else
            {
                ProductList = await _catalogApi.GetProducts();

                CategoryList = ProductList.Select(c => c.Category).Distinct().ToList();
            }


            return(Page());
        }