Navigation

Categories
Show Navigation Next Topic  »

Evaluator<TSource> class

Namespace: CodeEffects.Rule.Core

Provides core functionality for the evaluation of business rules when the exact type of the source object is known at design time. Read the rule evaluation topic for details.

Syntax

public class Evaluator<TSource> :
	CodeEffects.Rule.Core.EvaluatorBase

Notes

The TSource in the class' signature is the type of the source object class.

Constructors

  • Evaluator(System.String, GetRuleDelegate = null)
    Parameters:
    • rulesetXml, System.String - This string can contain either a single Rule XML document, a single <rule> node that contains a rule, or a collection of rules called the ruleset.
    • getRule, CodeEffects.Rule.Core.GetRuleDelegate - This nullable parameter takes a reference to a method that returns string Rule XML by rule ID. Pass this delegate if your rule may potentially reference reusable rules that are not stored in the same XML ruleset.

Methods

  • Evaluate(TSource, System.String = null) Returns: System.Boolean
    Parameters:
    • source, TSource - Instance of the source object.
    • ruleId, System.String - If the Rule XML passed to the constructor of this class is a ruleset then this nullable parameter contains the ID of the particular rule located inside of that ruleset. The generic Evaluator uses this ID to retrieve the rule from the ruleset and evaluate the source against it.

    For evaluation type rules, returns the result of the evaluation. For execution type rules, returns True if any rule action was invoked during the evaluation. Otherwise, returns False.


Post your questions on Stackoverflow and become a part of our growing community

Comments: 0