SharpControls.Validation 1.0.2

dotnet add package SharpControls.Validation --version 1.0.2
                    
NuGet\Install-Package SharpControls.Validation -Version 1.0.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="SharpControls.Validation" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpControls.Validation" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SharpControls.Validation" />
                    
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 SharpControls.Validation --version 1.0.2
                    
#r "nuget: SharpControls.Validation, 1.0.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.
#:package SharpControls.Validation@1.0.2
                    
#: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=SharpControls.Validation&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SharpControls.Validation&version=1.0.2
                    
Install as a Cake Tool

Validation

Validations for Numbers

  • required - The field must not be null or empty
  • positive - The field must be positive
  • negative - The field must be negative
  • max:{VALUE} - The field must be lower than VALUE
  • min:{VALUE} - The field muss be higher than VALUE
  • between:{VALUE1},{VALUE2} - The field must be between VALUE1 and VALUE2
  • equal:{VALUE} - The field must be equal to VALUE (Only use an integer value for this, due to floating point errors)
  • not_equal:{VALUE} - The field must not be equal to VALUE (Only use an integer value for this, due to floating point errors)

Validations for Datetimes

  • future - The field must be in the future
  • future_date - The date of the field must be in the future (Ignores Time)
  • past - The field must be in the past
  • past_date - The date of the field must be in the past (Ignores Time)
  • now - The field must be now
  • today - The date of the field must be today
  • this_month - The month of the date must be the current month
  • this_year - The year of the date must be the current year
  • max:{VALUE} - The field must be at maximum VALUE datetime
  • min:{VALUE} - The field must be at least VALUE datetime
  • before:{VALUE} - The field must be before VALUE
  • after:{VALUE} - The field must be after VALUE
  • between:{VALUE1},{VALUE2} - The field must be between VALUE1 and VALUE2
  • month:{VALUE} - The month of the field must be VALUE
  • year:{VALUE} - The year of the field must be VALUE
  • equal:{VALUE} - The field must be equal to VALUE
  • not_equal:{VALUE} - The field must not be equal to VALUE
  • equal_date:{VALUE} - The date of the field must be equal to VALUE
  • not_equal_date:{VALUE} - The date of the field must not be equal to VALUE

Validations for Strings

  • required - The field must not be null or empty
  • accepted - The field must be "true", "1" or "yes"
  • numeric - The field must be only numbers
  • integer - The field must be only numbers and not decimal
  • alpha - The field must be only Unicode alphabetic characters
  • alpha_dash - The field must be only Unicode alphabetic characters and - or _
  • email - The field must be a valid email address
  • cpf - The field must be a valid CPF, all characters other than numbers will be stripped
  • cnpj - The field must be a valid CNPJ, all characters other than numbers will be stripped
  • pis - The field must be a valid PIS, all characters other than numbers will be stripped
  • ip_address - The field must be a valid IP Address (IPv4 or IPv6)
  • ipv4 - The field must be a valid IPv4 address
  • ipv6 - The field must be a valid IPv6 address
  • uppercase - The field must be all uppercase
  • lowercase - The field must be all lowercase
  • url - The field must be a valid url
  • url_http - The field must be a valid http url
  • url_https - The field must be a valid https url
  • url_ftp - The field must be a valid ftp url
  • url_ftps - The field must be a valid ftps url
  • url_ssh - The field must be a valid ssh url
  • url_file - The field must be a valid file url
  • url_mailto - The field must be a valid mailto url
  • datetime - The field must be in a valid datetime format
  • max:{VALUE} - The field has maximum VALUE letters
  • min:{VALUE} - The field has minimum VALUE letters
  • len:{VALUE} - The field has exactly VALUE letters
  • between:{VALUE1},{VALUE2} - The field is between VALUE1 and VALUE2 letters long
  • phone:{VALUE} - The field is a valid phone number for VALUE country (3 letter code)
  • cellphone:{VALUE} - The field is a valid cellphone number for VALUE country (3 letter code)
  • landline:{VALUE} - The field is a valid landline number for VALUE country (3 letter code)
  • starts_with:{VALUE} - The field starts with VALUE
  • ends_with:{VALUE} - The field ends with VALUE
  • contains:{VALUE} - The field contains VALUE
  • like:{VALUE} - The field is like VALUE (Similar to MySQLs LIKE)
  • equal:{VALUE} - The field is the same as VALUE
  • not_equal:{VALUE} - The field is not the same as VALUE
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
1.0.2 214 2/16/2024
1.0.1 184 2/16/2024
1.0.0 180 2/16/2024

* Added datetime validations
* Updated SharpControls.Utils library to v1.0.3
* Minor fixes