public ActionResult ViewProductList(int typeId, int categoryId) { var model = new ProductListViewModel { Products = ShoppingCartCSV.GetProducts().Where(x => x.Type.Id.Equals(typeId) && x.Category.Id.Equals(categoryId)).ToList() }; return(View(model)); }
public ActionResult Index() { Session["accountId"] = 123; //temporary TODO: replace with retrieve from csv List <Product> products = ShoppingCartCSV.GetProducts(); List <ProductCategory> productCategories = ShoppingCartCSV.GetProductCategories().OrderBy(x => x.Name).ToList(); List <ProductType> productTypes = ShoppingCartCSV.GetProductTypes().OrderBy(x => x.Name).ToList(); var model = new HomeViewModel { ProductCategories = productCategories, ProductTypes = productTypes, Products = products }; return(View(model)); //return RedirectToAction("ViewProducts", "Product", null); }