Nexus.Tools.Validations 1.0.2.2

Suggested Alternatives

Nexus.Tools.Validations 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nexus.Tools.Validations --version 1.0.2.2                
NuGet\Install-Package Nexus.Tools.Validations -Version 1.0.2.2                
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="Nexus.Tools.Validations" Version="1.0.2.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nexus.Tools.Validations --version 1.0.2.2                
#r "nuget: Nexus.Tools.Validations, 1.0.2.2"                
#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 Nexus.Tools.Validations as a Cake Addin
#addin nuget:?package=Nexus.Tools.Validations&version=1.0.2.2

// Install Nexus.Tools.Validations as a Cake Tool
#tool nuget:?package=Nexus.Tools.Validations&version=1.0.2.2                

Nexus-Validations-Tools

GitHub license GitHub forks

Ferramentas de validação da Nexus é um pacote Nuget com um conjunto de ferramentas (atributos validáveis, metodos de formatação e etc..) para validação e formatação de propiedades em classes modelo (usando o esquema MVC ) utilizando atributos. Esse pacote feito por Juan Douglas, feito em nome e para a Nexus Company.

Para saber sobre versões e atualizações click aqui

Saiba como usar e veja exemplos aqui.

Atributos

Esta lista contém os atributos que serão ou já foram implementados ou a serem implementados

':heavy_check_mark:' Atributo já implementado

':x:' Atributo a ser implementado

Atributos de classes modelos

Esses atributos são usados para validar classes modelo

  • ✔️ Required: O campo e obrigatório e não aceita valores nulos.
  • ✔️ Password: O campo contém uma senha por isso deve conter uma letra minúscula, uma letra de maiúscula, um número e um caráter especial, além de ter no mínimo 8 caracteres.
  • ✔️ EmailAdress: Este atributo indica que o campo deve ser um e-mail seguindo o esquema user@domain.org RFC 822.
  • ✔️ Compare: Este atributo indica que o campo deve ter o mesmo valor do campo referenciado.
  • ✔️ UniqueInDatabase: Este atributo indica que o valor deste campo deve ser unico em sua tabela no banco de dados (para a validação o atributo uso EntityFramework).

Atributos de metodos

  • RequireAuthentication: Este atributo irá indicar que um contéudo deve ser acessado usando uma autenticação válida.

Usos e exemplos

Para utilizar os atributos e necessário adicionar o pacote Nexus.Tools.Validation, você pode adicionar o pacote utilizando o comando:

 dotnet add package Nexus.Tools.Validations

Este exemplo mostra um exemplo de uma classe modelo com atributos nome é e-mail onde todo a validação é feita usando os atributos da classe

Para saber mais sobre os atribtuos e suas funcionalidades click aqui

Exemplo:

using Nexus.Tools.Validations.Attributes;

namespace Example.Models
{
    public class ExampleModel
    {
        [Required]
        [EmailAddress]
        [StringLength(500)]
        [UniqueInDataBase(typeof(DbContext), typeof(Account), nameof(Account.Email))]
        public string Email { get; set; }

        [Password]
        [Required]
        [StringLength(50, MinimumLength = 8)]
        public string Password { get; set; }
        
        [Required]
        [Compare(nameof(Password))]
        public string ConfirmPassword { get; set; }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.

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.6.2 92 9/25/2024
1.0.6.1 111 9/25/2024
1.0.6 293 11/3/2023 1.0.6 is deprecated because it is no longer maintained and has critical bugs.
1.0.5 209 9/29/2023
1.0.4.6 492 7/6/2022 1.0.4.6 is deprecated because it is no longer maintained and has critical bugs.
1.0.4.5 481 5/27/2022 1.0.4.5 is deprecated because it is no longer maintained and has critical bugs.
1.0.4.4 471 3/31/2022 1.0.4.4 is deprecated because it is no longer maintained and has critical bugs.
1.0.4.3 469 3/31/2022 1.0.4.3 is deprecated because it is no longer maintained and has critical bugs.
1.0.4.2 459 3/31/2022 1.0.4.2 is deprecated because it is no longer maintained and has critical bugs.
1.0.4.1 507 2/17/2022 1.0.4.1 is deprecated because it is no longer maintained and has critical bugs.
1.0.4 496 1/29/2022 1.0.4 is deprecated because it is no longer maintained and has critical bugs.
1.0.3.4 312 1/7/2022 1.0.3.4 is deprecated because it is no longer maintained and has critical bugs.
1.0.3.3 315 12/30/2021 1.0.3.3 is deprecated because it is no longer maintained and has critical bugs.
1.0.3.2 405 10/28/2021 1.0.3.2 is deprecated because it is no longer maintained and has critical bugs.
1.0.3.1 375 10/25/2021 1.0.3.1 is deprecated because it is no longer maintained and has critical bugs.
1.0.3 631 10/2/2021 1.0.3 is deprecated because it is no longer maintained and has critical bugs.
1.0.2.2 394 9/18/2021 1.0.2.2 is deprecated because it is no longer maintained.
1.0.2.1 404 9/18/2021 1.0.2.1 is deprecated because it is no longer maintained.
1.0.2 413 9/18/2021 1.0.2 is deprecated because it is no longer maintained.

Critical Erro in StringLengthAttribute correction