Dev2.Providers.Validation.Rules.RuleSet.Add C# (CSharp) Method

Add() public method

public Add ( IRuleBase rule ) : void
rule IRuleBase
return void
        public void Add(IRuleBase rule)
        {
            if(rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            Rules.Add(rule);
        }

Usage Example

        protected virtual string ValidateArchivePassword(string password, string label, Action onError, bool contentIsRequired = true)
        {

            var errors = new List<IActionableErrorInfo>();
            RuleSet fileActivityRuleSet = new RuleSet();

            IsValidExpressionRule isValidExpressionRule = new IsValidExpressionRule(() => password, DataListSingleton.ActiveDataList.Resource.DataList);
            fileActivityRuleSet.Add(isValidExpressionRule);
            errors.AddRange(fileActivityRuleSet.ValidateRules(label, onError));

            UpdateErrors(errors);
            return password;

        }
All Usage Examples Of Dev2.Providers.Validation.Rules.RuleSet::Add