Exemple #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);
            }
        }
Exemple #2
0
 public bool Contain(string name, ProductTypes type)
 {
     return(_names.Any(n => ProductNameHelper.AreProductNamesEqual(n.Item2, n.Item1, type, name)));
 }
Exemple #3
0
 public bool Contain(string name, ProductTypes type)
 {
     return(_products.Any(p => ProductNameHelper.AreProductNamesEqual(p.Type, p.Name, type, name)));
 }
Exemple #4
0
 public void RemoveProduct(string name, ProductTypes type)
 {
     _products.RemoveAll(p =>
                         ProductNameHelper.AreProductNamesEqual(type, name, p.Type, p.Name));
 }