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