Table of Contents

Class RuleRepository

Namespace
NRules.Fluent
Assembly
NRules.Fluent.dll

Rules repository based on the rules defined inline using internal DSL. Use Load(Action<IRuleLoadSpec>) method to fluently load rules into the repository.

public class RuleRepository : IRuleRepository
Inheritance
RuleRepository
Implements
Inherited Members
Extension Methods

Constructors

RuleRepository()

Creates an empty rule repository with the default IRuleActivator.

public RuleRepository()
See Also

RuleRepository(IRuleActivator)

Creates an empty rule repository with the specified IRuleActivator.

public RuleRepository(IRuleActivator activator)

Parameters

activator IRuleActivator

Properties

Activator

Rules activator that instantiates rules based on a CLR type.

public IRuleActivator Activator { get; set; }

Property Value

IRuleActivator

Methods

Add(IRuleSet)

Adds a new rule set to the rule repository.

public void Add(IRuleSet ruleSet)

Parameters

ruleSet IRuleSet

Rule set to add.

Exceptions

ArgumentException

A rule set with the same name already exists.

GetRuleSets()

Retrieves all rule sets contained in the repository.

public IEnumerable<IRuleSet> GetRuleSets()

Returns

IEnumerable<IRuleSet>

Collection of rule sets.

Load(Action<IRuleLoadSpec>)

Loads rules into a rule set using provided loader specification. IRuleLoadSpec

public void Load(Action<IRuleLoadSpec> specAction)

Parameters

specAction Action<IRuleLoadSpec>

Rule loader specification.