Table of Contents

Class RuleFacts

Namespace
RuleWright.Core
Assembly
RuleWright.Core.dll

Several named facts evaluated as one — the multi-input shape. Each fact is addressed by its name as the first segment of a field path: with RuleFacts.With("customer", c).And("order", o), a rule reads customer.Age and order.Total.

A RuleFacts is a dictionary fact, so it runs the interpreter (CompilationMode.Interpreted) — the set of member types isn't a single CLR shape to compile against. Facts inside it are still read through the interpreter's cached reflection. When evaluation is hot enough that the compiled path matters, wrap the same inputs in a composite POCO (class Checkout { Customer Customer; Order Order; }) instead; the two spell the same field paths.

public sealed class RuleFacts : IReadOnlyDictionary<string, object?>, IReadOnlyCollection<KeyValuePair<string, object?>>, IEnumerable<KeyValuePair<string, object?>>, IEnumerable
Inheritance
RuleFacts
Implements
Inherited Members

Properties

Count
this[string]
Keys
Values

Methods

And(string, object?)

Adds another named fact.

ContainsKey(string)
GetEnumerator()
TryGetValue(string, out object?)
With(string, object?, bool)

Starts a named-facts collection with its first fact.