DesenviCore.Library
1.0.0
dotnet add package DesenviCore.Library --version 1.0.0
NuGet\Install-Package DesenviCore.Library -Version 1.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="DesenviCore.Library" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DesenviCore.Library --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DesenviCore.Library, 1.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.
// Install DesenviCore.Library as a Cake Addin #addin nuget:?package=DesenviCore.Library&version=1.0.0 // Install DesenviCore.Library as a Cake Tool #tool nuget:?package=DesenviCore.Library&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DesenviCore Library
Essa biblioteca é um conjunto de utilitários que são usados em todos os projetos aos quais eu desenvolvo usando .NET
Extensões
Extensions/DecimalExtension.cs
- ToStripeAmount: Converte decimal para inteiro no formato aceito pela SKD do Stripe
using DesenviCore.Library.Extensions;
decimal amount = 30.50M;
int stripeAmount = amount.ToStripeAmount();
Extensions/GuidExtension.cs
- ToCuid: Cria um identificador único curto
using DesenviCore.Library.Extensions;
var cuid = Guid.NewGuid().ToCuid(); // G0Sp5nSzU02Cz9FM5DgqnA
Interfaces
- Interfaces/IEntityBase: Responsável por padronizar entidades do banco de dados. Pode ser usado para qualquer banco de dados que use CUID ou identificador único do tipo string
- Interfaces/IRepositoryBase: Responsável por padronizar algumas operações básicas do banco de dados. Geralmente utilizado em bancos de dados que utilizam o EntityFramework
Tools
- Tools/EnvTool.cs
using DesenviCore.Library.Tools;
EnvTool.IsDebug(); // true se estiver no ambiente de debug
- Tools/GeneratorTool.cs
using DesenviCore.Library.Tools;
GeneratorTool.GenerateCode(); // Gera um código numérico com 6 dígitos
GeneratorTool.GenerateCode(10, 100); // Gera um número entre o primeiro e último parâmetro (ex: entre 10 e 100)
GenerateTool.GenerateCuid(); // Gera um CUID abstraindo a extensão ToCuid()
- Tools/ValidatorTool.cs
using DesenviCore.Library.Tools;
ValidatorTool.DocumentIsValid("000.000.000-00"); // Verifica se um CPF ou CNPJ é válido. Note que é apenas validação pelo dígito verificador. Não é feito nenhuma requisição
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- No dependencies.
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 |
---|---|---|
1.0.0 | 129 | 9/29/2023 |