public virtual void AddItem(Bookstore book, int qty) { CartLine line = Lines .Where(b => b.Bookstore.BookID == book.BookID) .FirstOrDefault(); if (line == null) { Lines.Add(new CartLine { Bookstore = book, Quantity = qty }); } else { line.Quantity += qty; } }
public virtual void RemoveLine(Bookstore book) => Lines.RemoveAll(x => x.Bookstore.BookID == book.BookID);
public override void RemoveLine(Bookstore bookstore) { base.RemoveLine(bookstore); Session.SetJson("Cart", this); }
public override void AddItem(Bookstore bookstore, int quantity) { base.AddItem(bookstore, quantity); Session.SetJson("Cart", this); }