Class CompiledRuleSet<T>
Represents a compiled rule set that can be evaluated at runtime.
public sealed class CompiledRuleSet<T> where T : class
Type Parameters
TThe type this rule set applies to.
- Inheritance
-
CompiledRuleSet<T>
- Inherited Members
Constructors
CompiledRuleSet(string, IEnumerable<CompiledRule<T>>)
Initializes a new instance of the CompiledRuleSet<T> class.
public CompiledRuleSet(string name, IEnumerable<CompiledRule<T>> rules)
Parameters
namestringThe name of the rule set.
rulesIEnumerable<CompiledRule<T>>The compiled rules.
Properties
Name
Gets the name of the rule set.
public string Name { get; }
Property Value
Rules
Gets the compiled rules in this set.
public IReadOnlyList<CompiledRule<T>> Rules { get; }
Property Value
TargetType
Gets the target type name.
public string TargetType { get; }
Property Value
Methods
Evaluate(T, RuleEvaluationOptions?)
Evaluates all rules against the specified instance.
public RuleEvaluationResult Evaluate(T instance, RuleEvaluationOptions? options = null)
Parameters
instanceTThe instance to evaluate.
optionsRuleEvaluationOptionsThe evaluation options.
Returns
- RuleEvaluationResult
The evaluation result.