Пример #1
0
 public CatalogViewModel(ShoppingCart cart, IEnumerable<string> categories, IEnumerable<Product> products)
 {
     TotalItemsInCart = cart.Items.Count();
     TotalCartValue = cart.Total;
     Categories = categories;
     CategoryProducts = products.Select(product => new ProductViewModel(product));
 }
Пример #2
0
 public ShoppingCartViewModel(ShoppingCart cart, IEnumerable<string> categories)
 {
     Categories = categories;
     ItemsCount = cart.Items.Count();
     TotalAmount = cart.Total;
     Items = cart.Items.Select(item => new ShoppingCartItemViewModel(item)).ToList();
 }
Пример #3
0
 ShoppingCart CreateCart()
 {
     var cart = new ShoppingCart();
     _shoppingCartRepository.Add(cart);
     return cart;
 }
Пример #4
0
 public ShoppingCartItem(ShoppingCart shoppingCart)
 {
     _shoppingCart = shoppingCart;
 }