Table of Contents

Class CompiledRule<T>

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

Represents a compiled rule that can be evaluated at runtime.

public sealed class CompiledRule<T> where T : class

Type Parameters

T

The type this rule applies to.

Inheritance
CompiledRule<T>
Inherited Members

Constructors

CompiledRule(RuleManifest, Func<T, bool>)

Initializes a new instance of the CompiledRule<T> class.

public CompiledRule(RuleManifest manifest, Func<T, bool> predicate)

Parameters

manifest RuleManifest

The rule manifest.

predicate Func<T, bool>

The compiled predicate.

Properties

Manifest

Gets the rule manifest containing metadata about the rule.

public RuleManifest Manifest { get; }

Property Value

RuleManifest

Predicate

Gets the compiled predicate that evaluates the rule.

public Func<T, bool> Predicate { get; }

Property Value

Func<T, bool>

Methods

Evaluate(T)

Evaluates the rule against the specified instance.

public bool Evaluate(T instance)

Parameters

instance T

The instance to evaluate.

Returns

bool

True if the rule passes; otherwise, false.