Example #1
0
        public void AddRuleItem(RuleItem ruleItem)
        {
            if (ruleItem == null)
            {
                throw new ArgumentNullException(nameof(ruleItem));
            }

            if (!ruleItem.IsValid())
            {
                throw new FailedValidationException();
            }

            if (_ruleItems.Any() && ruleItem.JoinType == JoinType.None)
            {
                throw new InvalidOperationException();
            }

            if (_ruleItems.Contains(ruleItem))
            {
                return;
            }

            _ruleItems.Add(ruleItem);
        }
Example #2
0
 public void RemoveRuleItem(RuleItem ruleItem)
 {
     _ruleItems.Remove(ruleItem);
 }