예제 #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;
 }