Validator.Register(
new Validator<Person>(
new Required<Person>(p => p.Name)), // Required property
new InRange<Person>(p => p.Age, 20, 30); // Age required to be in range [20, 30]
var person = new Person
{
Name = "",
Age = 25
};
Validator.For<Person>().Validate(person); // Throws exception.
var valid = Validator.For<Person>().Validate(person, silent: true); // Fails gracefully and returns false.
-
Notifications
You must be signed in to change notification settings - Fork 0
thrandre/ReallySimpleValidation
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published