SkillAgentSearch skills...

DataAnnotationsValidatorRecursive

Use DataAnnotations to validate your entire object graph

Install / Use

/learn @reustmd/DataAnnotationsValidatorRecursive
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DataAnnotationsValidatorRecursive

The helper will recursively traverse your object graph and invoke validation against DataAnnotations. This originated from following Stackoverflow answer: http://stackoverflow.com/a/8090614/605586

Installation

Available as NuGet-Package DataAnnotationsValidator:

Install-Package DataAnnotationsValidator

Usage

See file DataAnnotationsValidator/DataAnnotationsValidator.Tests/DataAnnotationsValidatorTests.cs

Short example:

var validator = new DataAnnotationsValidator.DataAnnotationsValidator();
var validationResults = new List<ValidationResult>();

validator.TryValidateObjectRecursive(modelToValidate, validationResults);
View on GitHub
GitHub Stars58
CategoryDevelopment
Updated4mo ago
Forks43

Languages

C#

Security Score

92/100

Audited on Nov 12, 2025

No findings