Exemple #1
0
        public async Task <IActionResult> OnGetAsync(string productId)
        {
            if (productId == null)
            {
                return(NotFound());
            }

            Product = await catalogueApi.GetCatalogue(productId);

            if (Product == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemple #2
0
        public async Task <IActionResult> OnGetAsync(string categoryName)
        {
            var productList = await catalogueApi.GetCatalogue();

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

            if (!string.IsNullOrEmpty(categoryName))
            {
                ProductList = await catalogueApi.GetCatalogueByCategory(categoryName);

                SelectedCategory = categoryName;
            }
            else
            {
                ProductList = productList;
            }

            return(Page());
        }
Exemple #3
0
        public async Task <IActionResult> OnGetAsync()
        {
            ProductList = await catalogueApi.GetCatalogue();

            return(Page());
        }