Table of Contents

Class DomainEngine

Namespace
JD.Domain.Runtime
Assembly
JD.Domain.Runtime.dll

Default implementation of the domain engine for rule evaluation.

public sealed class DomainEngine : IDomainEngine
Inheritance
DomainEngine
Implements
Inherited Members

Constructors

DomainEngine(DomainManifest)

Initializes a new instance of the DomainEngine class.

public DomainEngine(DomainManifest manifest)

Parameters

manifest DomainManifest

The domain manifest containing rules to evaluate.

Methods

EvaluateAsync<T>(T, RuleEvaluationOptions?, CancellationToken)

Evaluates domain rules against the specified instance asynchronously.

public ValueTask<RuleEvaluationResult> EvaluateAsync<T>(T instance, RuleEvaluationOptions? options = null, CancellationToken cancellationToken = default) where T : class

Parameters

instance T

The instance to evaluate.

options RuleEvaluationOptions

The evaluation options.

cancellationToken CancellationToken

The cancellation token.

Returns

ValueTask<RuleEvaluationResult>

The evaluation result.

Type Parameters

T

The type of the instance to evaluate.

Evaluate<T>(T, RuleEvaluationOptions?)

Evaluates domain rules against the specified instance synchronously.

public RuleEvaluationResult Evaluate<T>(T instance, RuleEvaluationOptions? options = null) where T : class

Parameters

instance T

The instance to evaluate.

options RuleEvaluationOptions

The evaluation options.

Returns

RuleEvaluationResult

The evaluation result.

Type Parameters

T

The type of the instance to evaluate.

Evaluate<T>(T, RuleSetManifest)

Evaluates the specified rule set against the instance.

public RuleEvaluationResult Evaluate<T>(T instance, RuleSetManifest ruleSet) where T : class

Parameters

instance T

The instance to evaluate.

ruleSet RuleSetManifest

The rule set to evaluate.

Returns

RuleEvaluationResult

The evaluation result.

Type Parameters

T

The type of the instance to evaluate.

Evaluate<T>(T, CompiledRuleSet<T>, RuleEvaluationOptions?)

Evaluates a compiled rule set against the specified instance. This method actually executes the rule predicates.

public RuleEvaluationResult Evaluate<T>(T instance, CompiledRuleSet<T> ruleSet, RuleEvaluationOptions? options = null) where T : class

Parameters

instance T

The instance to evaluate.

ruleSet CompiledRuleSet<T>

The compiled rule set to evaluate.

options RuleEvaluationOptions

The evaluation options.

Returns

RuleEvaluationResult

The evaluation result.

Type Parameters

T

The type of the instance to evaluate.