Skip to content

Validation

Three complementary approaches to validation — pick what fits your team.

  • Basic Usage First validator, Validate(), and collecting errors into Result<T>.

  • All Failures Collected Collect every validation error — not just the first — into a single Result<T>.

  • Pipeline Composition Chain validators and compose validation pipelines.

  • Custom Validators Build reusable, domain-specific validators.

  • Native Validation DSL Declarative rule DSL — NotEmpty, MaxLength, EmailAddress, Range, and more.

  • Validation Attributes [Validate] source generator — DataAnnotations → Result<T> automatically.

  • FluentValidation FluentValidation Bridge Keep existing FluentValidation validators, get Result<T> + SmartEndpoints auto-injection.