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
setsIEnumerable<RuleSet>The rule sets to merge, in order.
namestringOptional display name for the merged set.
stopAfterFirstMatchboolThe 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
Exceptions
- ArgumentNullException
setsis null or contains null.- ArgumentException
setsis empty, or two sets share a rule id.