Bikiran.Validation 1.0.9

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

Bikiran.Validation

NuGet Version License API Docs

A comprehensive validation library for .NET applications providing robust validation utilities for common data types and formats including emails, URLs, IP addresses, user credentials, files, phone numbers, server names, and more.

Features

  • 15+ Validation Types (Email, Date, IP, URL, File formats, Phone, Server names, etc.)
  • Extensible Validation Framework
  • Customizable Error Messages
  • Regex-Powered Validation
  • Null Safety Handling
  • Optional Field Support
  • Batch Validation for collections
  • Cross-Platform .NET Standard 2.0+ Support

Installation

dotnet add package Bikiran.Validation

Quick Start

using Bikiran.Validation;

// Validate an email
var emailResult = ValEmail.IsValidEmailFormat("user@example.com", "Email Address");
if (emailResult.Error)
{
    Console.WriteLine(emailResult.Message); // Display error
}

// Validate a password
var passwordResult = ValUser.IsValidPasswordFormat("SecurePass123!", "Password");
if (!passwordResult.Error)
{
    Console.WriteLine("Password is valid!");
}

// Validate a server name
var serverResult = ValServer.IsValidServerNameFormat("web-server-01", "Server Name");
if (!serverResult.Error)
{
    Console.WriteLine("Server name is valid!");
}

Available Validators

Validator Class Description Key Methods
ValEmail Email validation IsValidEmailFormat, IsValidEmailFormatAll
ValDate Date formatting IsValidDateFormat
ValUser User credentials IsCleanUserNameFormat, IsValidUserNameFormat, IsValidPasswordFormat
ValFile File validation IsValidImageFile, IsValidDocFormat, IsValidXlsxFormat
ValIP IP Address validation IsValidIpFormat, IsValidIpFormatAll
ValURL URL validation IsValidUrlFormat
ValString String validation IsValidString, IsValidLongString
ValNumber Numeric validation IsValidateInt, IsValidateNumber
ValBoolean Boolean checks IsEqual, IsTrue, IsFalse
ValOptions Option validation IsValidateOptions, IsValidateOptionsAll
ValPath Path validation IsValidPath
ValDomain Domain validation IsValidDomainFormat, IsValidDomainFormatAll
ValGit Git URL validation IsValidGitRepoSsh
ValPhone Phone validation IsValidPhoneNumberFormat
ValServer Server validation IsValidServerNameFormat

Advanced Usage

Custom Error Messages

// Customize the field name in error messages
var result = ValEmail.IsValidEmailFormat(email, "Work Email Address");
// Error message will be: "Please enter valid Work Email Address"

Optional Fields

// Use isOptional parameter for optional fields
var phoneResult = ValPhone.IsValidPhoneNumberFormat(phoneNumber, "Phone Number", isOptional: true);
if (!phoneResult.Error || phoneResult.Message == "Optional")
{
    // Field is either valid or empty (which is acceptable)
}

Customizable Length Constraints

// Customize min/max lengths
var usernameResult = ValUser.IsValidUserNameFormat(username, "Username", min: 3, max: 30);
var serverResult = ValServer.IsValidServerNameFormat(serverName, "Server", min: 3, max: 50, specialCharacter: "-_.");

Validation Rules Details

Password Requirements

  • 8-32 characters
  • 1 uppercase letter
  • 1 lowercase letter
  • 1 number
  • 1 special character

Username Requirements

IsCleanUserNameFormat (Strict alphanumeric):

  • 5-20 characters (customizable)
  • Only alphanumeric characters (a-z, A-Z, 0-9)
  • Must start with a letter or digit
  • Must end with a letter or digit

IsValidUserNameFormat (Allows special characters):

  • 5-20 characters (customizable)
  • Alphanumeric with .-@ allowed
  • Must start with a letter or digit
  • Must end with a letter or digit

Server Name Requirements

IsValidServerNameFormat:

  • 5-32 characters (customizable)
  • Alphanumeric (a-z, A-Z, 0-9) with customizable special characters (default: -_)
  • Must start with a letter or digit
  • Must end with a letter or digit
  • Special characters allowed only in the middle

File Validation

  • Images: JPEG, PNG, SVG (max 1MB)
  • Documents: PDF, DOC, DOCX (max 1MB)
  • Media Files: MP4, AVI, MP3, WAV (max 100MB)

Contribution

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Support

Found a bug? Please open an issue.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.9 444 1/25/2026
1.0.8 117 1/20/2026
1.0.7 267 7/6/2025
1.0.6 254 5/25/2025
1.0.5 221 5/21/2025
1.0.4 199 5/21/2025
1.0.3 200 5/21/2025
1.0.2 208 5/20/2025
1.0.1 204 5/20/2025

Version 1.0.9: Added server name validation (IsValidServerNameFormat) with customizable special characters support.