public ICartState Remove(Product item) { var newItems = new List<Product>(Items); newItems.Remove(item); return newItems.Count > 0 ? (ICartState)new CartStateActive(newItems) : new CartStateEmpty(); }
public ICartState Add(Product item) { var newItems = new List<Product>(Items) { item }; return new CartStateActive(newItems); }