Exemple #1
0
        public void InitData()
        {
            var product1 = new Product {Name = "Chomik"};
            session.Store(product1);

            session.SaveChanges();
        }
Exemple #2
0
        public void AddToCart(Product p, int count)
        {
            var entry = this.Products.SingleOrDefault(x => x.Product.Id == p.Id);

            if (entry != null)
            {
                entry.Count += count;
            }
            else
            {
                Products.Add(new CartEntry(p, count));
            }
        }
Exemple #3
0
 public CartEntry(Product product, int count)
 {
     this.product = product;
     this.Count = count;
 }