Navigation

Categories
Show Navigation Next Topic  »

Object.Evaluate<TSource> method

Declaring Class: CodeEffects.Rule.Core.RuleExtensions
Namespace: CodeEffects.Rule.Core

Evaluates instances of TSource type against Rule XML, and uses the generic evaluator class.

Returns

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.

Syntax

public static bool Evaluate<TSource>(
	this TSource source,
	string rulesetXml,
	string ruleId = null,
	GetRuleDelegate getRule = null)

Type Parameters

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.
  • ruleId, System.String - If the Rule XML passed in the previous parameter is a ruleset then this nullable parameter contains the ID of the particular rule located inside of that 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.

Example

bool success = sourceInstance.Evaluate(ruleXmlString, 1null);
Comments: 0
Post your questions about Code Effects on Stackoverflow and become a part of our growing community