public IResult Update(Product product)
        {
            IResult result = BuisnessRules.Run(CheckIfProductNameExists(product.ProductName),
                                               CheckIfProductCountOfCategoryCorrect(product.ProductId));

            if (result != null)
            {
                return(result);
            }
            _productDal.Update(product);
            return(new SuccessResult(Messages.ProductUpdate));
        }
        public IResult Add(Product product)
        {
            IResult result = BuisnessRules.Run(CheckIfProductNameExists(product.ProductName),
                                               CheckIfProductCountOfCategoryCorrect(product.ProductId), CheckIfCategoryLimitExceded());

            if (result != null)
            {
                return(result);
            }
            _productDal.Add(product);
            return(new SuccessResult(Messages.ProductAdded));
        }