Example #1
0
        public void RemoveGoodsSet(GoodsSet set)
        {
            if (!goodsSets.Contains(set))
            {
                throw new ArgumentException($"Goods with name {set.Goods.Name} not found");
            }

            goodsSets.Remove(set);
            CacheGoodsSets();
        }
Example #2
0
        public void AddGoodsSet(GoodsSet set)
        {
            if (HasGoods(set.Goods))
            {
                throw new ArgumentException($"{set.Goods.Name} already in cart");
            }

            goodsSets.Add(set);
            CacheGoodsSets();
        }