Skip to content

Release v22.7.0

Choose a tag to compare

@github-actions github-actions released this 30 Aug 17:19
870d2ec

Added

  • RuleFor(...).IgnoreConceptRules() on the concept-flavored RuleFor overload, so a validator can suppress a cross-cutting ConceptValidator<T> for one of its own properties.

ModelGraphValidator runs a registered ConceptValidator<T> against every occurrence of that concept anywhere in a model's graph, which is the point of the mechanism. It also means a command whose own property names the entity it is creating cannot coexist with a "must already exist" check on that concept type: the nested validator is invoked with a fresh validation context holding only the value, so it has no way to know which command carried it, and the creating command has no way to exempt itself.

The exclusion is scoped to exactly that property on that model. A sibling of the same concept type still gets checked, and the same concept type on any other model is untouched. It is only reachable from the concept overload — IConceptRuleBuilder<T, TValue> — so it cannot be called on a plain primitive RuleFor.

Consumers with no concept validators are unaffected; nothing changes unless the method is called.