To understand how to use the RuleEngine project please read the following posts at my blog.
That example shows how two person objects are validated against the two rules " Name = 'mathias' " and " Age = 35 '.
Person person1 = new Person() { Name = "Mathias", Age = 35, Children = 2 };
Person person2 = new Person() { Name = "Anna", Age = 32, Children = 2 };
ExpressionRuleLoader expressionRuleLoader = new ExpressionRuleLoader();
// new Rule(" Name = 'mathias' ");
Rule rule1 = expressionRuleLoader.Load(1);
// new Rule(" Age = 35 ");
Rule rule2 = expressionRuleLoader.Load(2);
RuleValidator ruleValidator = new RuleValidator();
var result = ruleValidator.ValidateExpressionRulesAll(new Person[] { person1, person2 },
    new Rule[] { rule1, rule2 });

Last edited Sep 17, 2014 at 1:33 PM by netmatze, version 6

Comments

No comments yet.