https://github.com/lucasmendesl/fluentvalidation.extensions.br
An extension of the fluent validation with a set of Brazilian validations
https://github.com/lucasmendesl/fluentvalidation.extensions.br
brazilian csharp fluentvalidation validation
Last synced: about 1 month ago
JSON representation
An extension of the fluent validation with a set of Brazilian validations
- Host: GitHub
- URL: https://github.com/lucasmendesl/fluentvalidation.extensions.br
- Owner: LucasMendesl
- License: mit
- Created: 2017-11-15T04:36:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-10T16:24:26.000Z (over 2 years ago)
- Last Synced: 2025-04-23T20:24:44.481Z (about 1 month ago)
- Topics: brazilian, csharp, fluentvalidation, validation
- Language: JavaScript
- Size: 27.3 KB
- Stars: 34
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# FluentValidation.Extensions.Br
> An extension of the fluent validation with a set of Brazilian validations[](https://www.nuget.org/packages/Extensions.FluentValidation.Br/)
[🇧🇷 Switch to portuguese version](./README.pt_br.md)
## Main Goal
The prupose of this library is create a extension with brazilian´s validation to [FluentValidation](https://github.com/JeremySkinner/FluentValidation) package.## Description
This library was designed to provide a set of brazilian´s attributes validation such as CPF, CNPJ## Install
Install with Package Manager**Nuget**
```
PM > Install-Package Extensions.FluentValidation.Br
```Install with .NET CLI
**.NET CLI**
```
dotnet add package Extensions.FluentValidation.Br
```## How to Use ?
```csharp
public class Person
{
public string Name { get; set; }
public string CPF { get; set; }
public string CNPJ { get; set; }
}public class PersonValidator : AbstractValidator
{
public PersonValidator ()
{
RuleFor(employee => employee.Name).NotNull();
RuleFor(employee => employee.CPF).IsValidCPF();
RuleFor(employee => employee.CNPJ).IsValidCNPJ();
}
}
```## Run Tests
```
dotnet test
```## Contributing
Contributions via pull requests are welcome :-).## License
MIT © [Lucas Mendes Loureiro](http://github.com/lucasmendesl)