dotnet-validation-patterns

Installation
SKILL.md

dotnet-validation-patterns

Built-in .NET validation patterns that do not require third-party packages. Covers DataAnnotations attributes, IValidatableObject for cross-property validation, IValidateOptions<T> for options validation at startup, custom ValidationAttribute authoring, and Validator.TryValidateObject for manual validation. Prefer these built-in mechanisms as the default; reserve FluentValidation for complex domain rules that outgrow declarative attributes.

Scope

  • DataAnnotations attributes and Validator.TryValidateObject
  • IValidatableObject for cross-property validation
  • IValidateOptions for options validation at startup
  • Custom ValidationAttribute authoring

Out of scope

  • API pipeline integration (endpoint filters, ProblemDetails, AddValidation) -- see [skill:dotnet-input-validation]
  • Options pattern binding and ValidateOnStart registration -- see [skill:dotnet-csharp-configuration]
  • Architectural placement of validation in layers -- see [skill:dotnet-architecture-patterns]

Cross-references: [skill:dotnet-input-validation] for API pipeline validation and FluentValidation, [skill:dotnet-csharp-configuration] for Options pattern binding and ValidateOnStart(), [skill:dotnet-architecture-patterns] for validation placement in architecture layers, [skill:dotnet-csharp-coding-standards] for naming conventions.

Installs
3
GitHub Stars
219
First Seen
Feb 24, 2026
dotnet-validation-patterns — novotnyllc/dotnet-artisan