public ActionResult ProductList() { HomeProductListViewModel model = new HomeProductListViewModel(); List <Product> productList = listOfProducts.Include(p => p.Images).ToList(); model.ListOfProducts = productList; return(View(model)); }
public ActionResult Index() { createInitialDataIfNotExist(); HomeProductListViewModel model = new HomeProductListViewModel(); List <Product> suggestedList = suggestedProducts.Include(p => p.Images).ToList(); List <Product> latestList = latestProducts.Include(p => p.Images).ToList(); model.SuggestedProducts = suggestedList; model.LatestProducts = latestList; return(View(model)); }