Interface IValidationRule<TModel>
- Namespace
- EncDotNet.S100.Validation
- Assembly
- EncDotNet.S100.Core.dll
A single S-100 validation rule that examines an instance of
TModel and yields zero or more
ValidationFinding entries.
public interface IValidationRule<in TModel>
Type Parameters
TModelThe typed data model the rule operates on, typically a typed dataset projection such as
S421RoutePlan,S124Dataset, orS102Dataset.
Remarks
Implementations must be pure with respect to the input — repeated evaluation of the same model with the same context must yield equivalent findings. Rules must not throw for malformed input; they should surface suspicions as findings instead. (The runner catches exceptions defensively to guarantee report aggregation even when a single rule misbehaves.)
The fluent RuleFor<TModel>(string) entry point is the recommended way to author simple property-style rules. More complex rules — for example Tier-3 rules that need to reach a sibling dataset via Services — should implement this interface directly.
Properties
DefaultSeverity
The default severity used by findings this rule emits when the rule itself does not override it per-finding.
ValidationSeverity DefaultSeverity { get; }
Property Value
Description
Human-readable summary of the normative requirement this rule enforces. Surfaced in tooling and documentation.
string Description { get; }
Property Value
RuleId
Stable identifier traceable to a clause of the relevant IHO product
specification (e.g. "S421-R-3.1").
string RuleId { get; }
Property Value
Methods
Evaluate(TModel, ValidationContext)
Evaluates the rule against model, returning all
findings produced. Returns an empty sequence when no issues are
found.
IEnumerable<ValidationFinding> Evaluate(TModel model, ValidationContext context)
Parameters
modelTModelcontextValidationContext