Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

KimPiks/ValidatorLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ValidatorLib

A simple library for data validation.

Documentation

Documentation

Installation

Validation Lib can be installed using one of these commands

PM> Install-Package ValidatorLib
> dotnet add package ValidatorLib

Tests and benchmarks

Tests and benchmarks can be found in /src/tests/

License

MIT

Usage/Examples

var str = "[email protected]";
try
{
    Validator.Validate(str).IsEmailAddress();
    Validator.Validate(str).MinLength(8);
    Validator.Validate(str).IsNotEmpty();
}
catch (ArgumentException e)
{
    // If an exception is thrown, the string is not valid
}
var str = "[email protected]";
try
{
    var validator = new CustomValidator<string>();
    
    validator.AddRule(x => Validator.Validate(x).IsEmailAddress());
    validator.AddRule(x => Validator.Validate(x).MinLength(8));
    validator.AddRule(x => Validator.Validate(x).IsNotEmpty());

    validator.Validate(str);
}
catch (ArgumentException e)
{
    // If an exception is thrown, the string is not valid
}

For more examples let's see /examples/

Support

For support, email [email protected]

Feedback

If you have any feedback, please reach out to me at [email protected]

Authors

Contributing

Contributions are always welcome!

Remember to edit README.md and documentation.md

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages