public async Task <IActionResult> OnGetAsync(string productId) { if (productId == null) { return(NotFound()); } Product = await catalogueApi.GetCatalogue(productId); if (Product == null) { return(NotFound()); } return(Page()); }
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()); }
public async Task <IActionResult> OnGetAsync() { ProductList = await catalogueApi.GetCatalogue(); return(Page()); }