Пример #1
0
 public ActionResult Category(int categoryId)
 {
     var products = _catalogService.GetProductsOfCategory(categoryId);
     var productsViewModel = new ProductsListViewModel()
     {
         ItemInCart = GetItemsInCart(),
         Products = products.Select(
                 x => new ProductListViewModel().InjectFrom(x) as ProductListViewModel)
                 .ToList()
     };
     return View(productsViewModel);
 }
Пример #2
0
 public ActionResult Index()
 {
     var products = _catalogService.GetMostPurchased();
     var productsViewModel = new ProductsListViewModel()
     {
         ItemInCart = GetItemsInCart(),
         Products = products.Select(
                 x => new ProductListViewModel().InjectFrom(x) as ProductListViewModel)
                 .ToList()
     };
     return View(productsViewModel);
 }