Table of Contents

Class CompiledRuleSet<T>

Namespace
JD.Domain.Rules
Assembly
JD.Domain.Rules.dll

Represents a compiled rule set that can be evaluated at runtime.

public sealed class CompiledRuleSet<T> where T : class

Type Parameters

T

The 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

name string

The name of the rule set.

rules IEnumerable<CompiledRule<T>>

The compiled rules.

Properties

Name

Gets the name of the rule set.

public string Name { get; }

Property Value

string

Rules

Gets the compiled rules in this set.

public IReadOnlyList<CompiledRule<T>> Rules { get; }

Property Value

IReadOnlyList<CompiledRule<T>>

TargetType

Gets the target type name.

public string TargetType { get; }

Property Value

string

Methods

Evaluate(T, RuleEvaluationOptions?)

Evaluates all rules against the specified instance.

public RuleEvaluationResult Evaluate(T instance, RuleEvaluationOptions? options = null)

Parameters

instance T

The instance to evaluate.

options RuleEvaluationOptions

The evaluation options.

Returns

RuleEvaluationResult

The evaluation result.