Example #1
0
        public void AddProduct(Product product)
        {
            if (_forbiddenProductNames.Contain(product.Name, product.Type))
            {
                return;
            }

            if (!_products.Any(p => ProductNameHelper.AreProductNamesEqual(
                                   product.Type, product.Name, p.Type, p.Name)))
            {
                _products.Add(product);
            }
        }
Example #2
0
 public bool Contain(string name, ProductTypes type)
 {
     return(_names.Any(n => ProductNameHelper.AreProductNamesEqual(n.Item2, n.Item1, type, name)));
 }
Example #3
0
 public bool Contain(string name, ProductTypes type)
 {
     return(_products.Any(p => ProductNameHelper.AreProductNamesEqual(p.Type, p.Name, type, name)));
 }
Example #4
0
 public void RemoveProduct(string name, ProductTypes type)
 {
     _products.RemoveAll(p =>
                         ProductNameHelper.AreProductNamesEqual(type, name, p.Type, p.Name));
 }