NetDevPack.Brasil 3.0.0

dotnet add package NetDevPack.Brasil --version 3.0.0
                    
NuGet\Install-Package NetDevPack.Brasil -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetDevPack.Brasil" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetDevPack.Brasil" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetDevPack.Brasil" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetDevPack.Brasil --version 3.0.0
                    
#r "nuget: NetDevPack.Brasil, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetDevPack.Brasil@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetDevPack.Brasil&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetDevPack.Brasil&version=3.0.0
                    
Install as a Cake Tool

<img src="https://repository-images.githubusercontent.com/269783213/ded11000-a765-11ea-8590-6ed700685675" alt=".NET DevPack" width="300px" />

O que é o .NET DevPack Brasil?

Uma coleção de utilidades para o Brasil: documentos nacionais (CPF, CNPJ, Título de Eleitor) e CEP, com validação e formatação. Foi feito para ser usado junto com o NetDevPack.

Dê uma estrela! ⭐

Se você gostou do projeto ou se o NetDevPack te ajudou, deixe uma estrela 😉

Como começar

dotnet add package NetDevPack.Brasil
Pacote Versão Downloads
NetDevPack.Brasil NuGet Nuget

Compatibilidade

Versão Target framework NetDevPack
3.x .NET 10 (LTS) 9.x
2.x .NET Standard 2.1, .NET 8, 9 e 10 8.x

Exemplos

Os construtores validam o valor e lançam NetDevPack.Domain.DomainException quando ele é inválido. Máscara e caracteres não numéricos são ignorados.

using NetDevPack.Brasil.Documentos;
using NetDevPack.Brasil.Localizacao;

var cpf = new Cpf("915.212.540-87");
cpf.SemMascara();   // "91521254087"
cpf.ComMascara();   // "915.212.540-87"

var cnpj = new Cnpj("11.444.777/0001-61");
cnpj.ComMascara();  // "11.444.777/0001-61"

var titulo = new TituloEleitor("1023 8501 0671");

var cep = new Cep("01310-100");
cep.EstaValido();   // true
cep.ComMascara();   // "01310-100"

Também dá para validar sem criar o objeto, com CpfValidador, CnpjValidador e TituloEleitorValidator (namespace NetDevPack.Brasil.Documentos.Validacao) e CepValidador (NetDevPack.Brasil.Localizacao.Validacao).

Sobre

O .NET DevPack Brasil foi desenvolvido por Eduardo Pires sob a licença MIT.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 51 11/18/2026
2.0.0 492 2/5/2026
1.2.0 2,959 8/24/2021
1.1.2 532 8/14/2021
1.1.1 552 8/12/2021