Cookbook

Task-oriented recipes for common application scenarios. Each recipe is self-contained and links to the deeper guide for the underlying concept.

Recipes

  1. Validate a minimal API request
  2. Validate an MVC controller
  3. Validate a MediatR command
  4. Validate a Blazor form
  5. Rule sets and partial updates
  6. Custom rules with shared context
  7. Localized validation messages
  8. Test validators
  9. Emit JSON Schema, OpenAPI, and client rules
  10. Validate a desktop view model

Conventions

  • Examples target .NET 10 (LTS) and the preview package 1.0.0-preview.2; the .NET 11 bridge and OpenAPI packages add net11.0 assets.
  • Register validators as IValidator<T> (scoped or singleton).
  • Use the async path when the validator has async rules.