Interface IModelGraphValidator
- Namespace
- Cratis.Arc.Validation
- Assembly
- Cratis.Arc.Core.dll
Defines a system that validates an object graph by running every discoverable validator that applies to it.
public interface IModelGraphValidator
- Extension Methods
Remarks
Whether a value is well formed is a property of its type, not of the operation carrying it — a ConceptValidator<T> for an identifier means the same thing on a command as it does on a query argument. This is the single traversal both pipelines use, so a validator behaves identically wherever the value it guards appears.
Methods
Validate(ModelGraphValidationRequest, CancellationToken)
Validates an object graph, running validators for the root and for everything reachable from it.
Task<IEnumerable<ValidationResult>> Validate(ModelGraphValidationRequest request, CancellationToken cancellationToken = default)
Parameters
requestModelGraphValidationRequestThe ModelGraphValidationRequest describing what to validate.
cancellationTokenCancellationTokenOptional CancellationToken for cancelling the validation.
Returns
- Task<IEnumerable<ValidationResult>>
The ValidationResult collection describing every failure found, empty when valid.