Table of Contents

Namespace NRules.Fluent.Dsl

Contains types that allow specifying rules using internal DSL in C#.

Classes

ContextExtensions
DescriptionAttribute

Sets rule's description.

NameAttribute

Sets rule's name. Name set via the attribute overrides the default name, which is the fully qualified class name.

PriorityAttribute

Sets rule's priority. If multiple rules get activated at the same time, rules with higher priority get executed first. Priority value can be positive, negative or zero. Default priority is zero.

QueryExpression<TSource>

Expression builder for queries.

QueryExtensions
RepeatabilityAttribute

Sets rule's repeatability, that is, how it behaves when it is activated with the same set of facts multiple times, which is important for recursion control. By default rules are Repeatable, which means a rule will fire every time it is activated with the same set of facts. If repeatability is set to NonRepeatable then the rule will not fire with the same combination of facts, unless that combination was previously deactivated (i.e. through retraction).

Rule

Base class for inline rule definitions. To create a rule using internal DSL, create a class that inherits from NRules.Fluent.Dsl.Rule and override Define() method. Use When() and Then() methods to define rule's conditions and actions correspondingly. A rule can also be decorated with attributes to add relevant metadata: NameAttribute, DescriptionAttribute, TagAttribute, PriorityAttribute, RepeatabilityAttribute.

TagAttribute

Adds a tag to rule's metadata. A rule class can have multiple tag attributes, and also inherits tag attributes from its parent classes. Tags can be used to filter rules when loading them through fluent load specification.

Interfaces

ICollectQuery<TSource>

Intermediate query chain element used for Collect modifiers.

IDependencyExpression

Rule's dependencies expression builder.

IFilterExpression

Rule's filters expression builder.

ILeftHandSideExpression

Rule's left-hand side (conditions) expression builder.

IOrderedQuery<TSource>

Intermediate query chain element used for OrderBy modifiers.

IQuery

Root of the query method chain.

IQueryBuilder

Internal builder for queries.

IQuery<TSource>

Intermediate query chain element.

IRightHandSideExpression

Rule's right-hand side (actions) expression builder.