Skip to main content
Table of Contents

Interface IValidator<T>

Namespace
Stratara.Abstractions.Validation
Assembly
Stratara.Abstractions.dll

Validates instances of T. The framework default validation behavior runs every registered IValidator<T> for a request before the handler executes.

public interface IValidator<in T>

Type Parameters

T

The type this validator inspects.

Extension Methods

Remarks

The contract is intentionally vendor-neutral and FluentValidation-shape-compatible: a thin adapter can wrap a FluentValidation validator without losing failure detail. Implementations must never return null — return Success when the instance is valid.

Methods

ValidateAsync(T, CancellationToken)

Validate instance and return the detected failures.

ValueTask<ValidationResult> ValidateAsync(T instance, CancellationToken cancellationToken = default)

Parameters

instance T

The instance to validate.

cancellationToken CancellationToken

Token to observe while validating.

Returns

ValueTask<ValidationResult>

A ValidationResult; Success when valid.