public void OnGet(int?id)
 {
     if (id.HasValue)
     {
         Products = _productManager.GetProductsByCategoryId(id.Value);
         var category = _productManager.GetCategoryById(id.Value);
         CategoryName = category != null ? category.CategoryName : "Category not Found";
     }
     else
     {
         Products     = _productManager.GetProducts();
         CategoryName = "All Categories";
     }
 }
Beispiel #2
0
 public void OnGet()
 {
     Products = _productManager.GetProducts();
 }