Skip to content

Compono.CompositionConfigurationError.DuplicateRule

Compono

Compono.CompositionConfigurationError

CompositionConfigurationError.DuplicateRule Class

The same configuration \<em>value\</em> rule was set more than once across a single Create(Action<CompositionBuilder>) callback - a type rule for the same type twice, or a member rule for the same (declaring type, member name) pair twice. A member rule and a type rule that could both match the same request are never a conflict with each other, even though both may apply - they're different specificity, not the same key. A duplicate member-scoped WithCollectionSize override is a distinct case (DuplicateCollectionSizeOverride), not this one - a size override never compiles into a stage-4 rule, so reporting it as "a rule" would be misleading (PR #19 review). See docs/adr/0020-composition-configuration-rules.md.

public sealed record CompositionConfigurationError.DuplicateRule : Compono.CompositionConfigurationError, System.IEquatable<Compono.CompositionConfigurationError.DuplicateRule>

Inheritance System.ObjectCompositionConfigurationError → DuplicateRule

Implements System.IEquatable<DuplicateRule>

Constructors
DuplicateRule(Type, string, IReadOnlyList<ConfigurationSource>) Creates a DuplicateRule error.
Properties
MemberName The member name, for a member rule - null for a type rule.
RuleType A type rule's own type, or a member rule's declaring type.
Sources Every call that set this rule, in call order - always at least two. A genuinely immutable snapshot (Compono.ImmutableSnapshot), same guarantee as Sources.