Click or drag to resize

IRuleApiEvalT Method (String, IDictionaryString, Object)

Evaluate a rule with parameters.

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
T Eval<T>(
	string ruleName,
	IDictionary<string, Object> parameters
)

Parameters

ruleName
Type: SystemString
Name of the rule.
parameters
Type: System.Collections.GenericIDictionaryString, Object
Parameters to evaluate condition in rule.

Type Parameters

T
Return value type

Return Value

Type: T
Value return from rule expression
Examples
var ruleApi = ctx.Use<IRuleApi>();
var parameters = new Dictionary<string, object>();
parameters.Add("Username","tester");
var passed = ruleApi.Eval<int>("Demo rule vs parameter", parameters);
See Also