Table of Contents

Method Merge

Namespace
RuleWright.Core
Assembly
RuleWright.Core.dll

Merge(IEnumerable<RuleSet>, string?, bool)

Composes several rule sets into one — RuleWright's equivalent of workflow injection. Rules keep their source order (set by set), and the usual per-set invariants apply to the merged whole: rule ids must be unique across all the sets, so two sets that each define a vip-discount fail loudly here rather than silently shadowing each other. Composition is a load-time concern by design: rule documents stay self-contained, with no include or reference mechanism to resolve.

public static RuleSet Merge(IEnumerable<RuleSet> sets, string? name = null, bool stopAfterFirstMatch = false)

Parameters

sets IEnumerable<RuleSet>

The rule sets to merge, in order.

name string

Optional display name for the merged set.

stopAfterFirstMatch bool

The merged set's own stop-after-first-match semantics. Deliberately not inherited from the sources: what "first match" means across combined sets is the composer's decision.

Returns

RuleSet

Exceptions

ArgumentNullException

sets is null or contains null.

ArgumentException

sets is empty, or two sets share a rule id.