This class can be used to pass parameters of the rule evaluation to one of the evaluator classes.
public class EvaluationParameters
LINQProviderType Type: CodeEffects.Rule.Core.LinqProviderType
Gets or sets the type of LINQ provider. Right now only three providers are supported: LINQ-to-Object, LINQ-to-SQL, and LINQ-to-Entities. Other providers may work as well as long as they implement the same sub-set of commands as LINQ-to-SQL. Use the Default value for all other providers.
MaxIterations Type: System.Int32
Gets or sets the value of the maximum number of iterations before evaluation fails in the Loop mode. The default value of -1 sets no limits.
PerformNullChecks Type: System.Boolean
Gets or sets the value indicating whether the engine builds null-pointer safety checks into compiled code to avoid run-time exceptions. The default value is True.
RuleGetter Type: CodeEffects.Rule.Core.GetRuleDelegate
Delegate for requesting missing rules (rules that are being referenced but not included in the ruleset). This property is optional.
RuleId Type: System.String
Id of the rule to be evaluated or compiled. This property is optional.
Scope Type: CodeEffects.Rule.Core.EvaluationScope
Gets or sets the value that specifies how to treat multiple rules in a ruleset when they are evaluated in one step using the Ruleset mode. The default value is EvaluationScope.All.
ShortCircuit Type: System.Boolean
Gets or sets the value indicating whether to stop further evaluation of a rule immediatelly after the result is determined. The default value is True.
The ShortCircuit parameter does not apply to individual statements, only to rules themselves and works in conjunction with the Scope parameter.
To illustrate this, suppose you have three rules A, B, and C as a part of a single ruleset. Then the following table represents possible states:
||A short-and B short-and C
||Rules are evaluated sequentially applying logical AND operator. Evaluation stops as soon as one rule returns False.
||A and B and C
||All rules are evaluated and results are combined using logical AND.
||A short-or B short-or C
||Rules are evaluated sequentially applying logical OR operator. Evaluation stops as soon as one rule returns True.
||A or B or C
||All rules are evaluated and results are combined using logical OR.
Individual rules are still evaluated using short-circuit logic.
This behavior applies in two cases:
- Evaluating multiple rules at once as a part of a larger ruleset. Call the Evaluator.Evaluate(TSource, EvaluationScope, bool) overload.
- Evaluating a single rule that contains multiple if-statements. Pass settings in the EvaluationParameters parameter of the Evaluator constructor.
Post your support requests on Stackoverflow.com
. You can also post your comments and product feedback using the form at the bottom of this page.