Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

TechNobre/PowerUtils.Validations.Primitives

Repository files navigation

PowerUtils.Validations.Primitives

⚠️ DEPRECATED

This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project.

Logo

Provides additional constants for libraries based on validations

License: MIT

Support to

  • .NET 6.0
  • .NET 5.0
  • .NET 3.1

How to use

Install NuGet package

This package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.Validations.Primitives

Nuget

Install-Package PowerUtils.Validations.Primitives

.NET CLI

dotnet add package PowerUtils.Validations.Primitives

Constants

  • REQUIRED;
  • INVALID;
  • UNAUTHORIZED;
  • FORBIDDEN;
  • MIN;
  • MAX;
  • MIN_ZERO (MIN:0);
  • MAX_ZERO (MAX:0);
  • MIN_DATETIME_UTCNOW (MIN:DATETIME_UTCNOW);
  • MAX_DATETIME_UTCNOW (MAX:DATETIME_UTCNOW);
  • MIN_LATITUDE (MIN:-90);
  • MAX_LATITUDE (MAX:90);
  • MIN_LONGITUDE (MIN:-180);
  • MAX_LONGITUDE (MAX:180);
  • DUPLICATED;
  • NOT_FOUND;
  • EXPIRED;

Helpers

GetMinFormatted

Supports the types string, int, uint, long, ulong, float, double, decimal, DateTime

// result = "MIN:14"
var result = Helpers.GetMinFormatted(14);

GetMaxFormatted

Supports the types string, int, uint, long, ulong, float, double, decimal, DateTime

// result = "MAX:1244574"
var result = Helpers.GetMaxFormatted(1244574);

⚠️ Warning

The constant ALREADY_EXISTS will be removed in 2022/09/30.

Contribution

If you have any questions, comments, or suggestions, please open an issue or create a pull request