Class DomainEngine
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
manifestDomainManifestThe 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
instanceTThe instance to evaluate.
optionsRuleEvaluationOptionsThe evaluation options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<RuleEvaluationResult>
The evaluation result.
Type Parameters
TThe 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
instanceTThe instance to evaluate.
optionsRuleEvaluationOptionsThe evaluation options.
Returns
- RuleEvaluationResult
The evaluation result.
Type Parameters
TThe 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
instanceTThe instance to evaluate.
ruleSetRuleSetManifestThe rule set to evaluate.
Returns
- RuleEvaluationResult
The evaluation result.
Type Parameters
TThe 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
instanceTThe instance to evaluate.
ruleSetCompiledRuleSet<T>The compiled rule set to evaluate.
optionsRuleEvaluationOptionsThe evaluation options.
Returns
- RuleEvaluationResult
The evaluation result.
Type Parameters
TThe type of the instance to evaluate.