Fox.ValidationKit 1.0.0

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

Fox.ValidationKit

Lightweight .NET validation library with fluent API and zero dependencies

Fox.ValidationKit is a lightweight, expressive validation library for .NET with a fluent API. It provides strongly-typed validation rules with support for synchronous and asynchronous validation, custom rules, and optional ResultKit integration.

Installation

dotnet add package Fox.ValidationKit

NuGet Package Manager:

Install-Package Fox.ValidationKit

PackageReference:

<PackageReference Include="Fox.ValidationKit" Version="1.0.0" />

Quick Start

1. Define Your Model

public sealed class User
{
    public string? FirstName { get; set; }
    public string? LastName { get; set; }
    public string? Email { get; set; }
    public int Age { get; set; }
}

2. Create a Validator

public sealed class UserValidator : Validator<User>
{
    public UserValidator()
    {
        RuleFor(x => x.FirstName)
            .NotEmpty("First name is required")
            .MinLength(2)
            .MaxLength(50);

        RuleFor(x => x.LastName)
            .NotEmpty("Last name is required")
            .MinLength(2)
            .MaxLength(50);

        RuleFor(x => x.Email)
            .NotEmpty("Email is required")
            .EmailAddress("Invalid email format");

        RuleFor(x => x.Age)
            .GreaterThan(0, "Age must be positive")
            .LessThan(150, "Age must be realistic")
            .Custom((user, age) => age >= 18, "User must be at least 18 years old");
    }
}

3. Validate Your Data

var validator = new UserValidator();
var user = new User
{
    FirstName = "John",
    LastName = "Doe",
    Email = "john.doe@example.com",
    Age = 25
};

var result = validator.Validate(user);

if (result.IsValid)
{
    Console.WriteLine("User is valid!");
}
else
{
    foreach (var error in result.Errors)
    {
        Console.WriteLine($"{error.PropertyName}: {error.Message}");
    }
}

Features

  • Fluent API - Intuitive, type-safe validation rule configuration
  • Zero Dependencies - No external dependencies, only .NET BCL
  • Strongly Typed - Expression-based property selection with IntelliSense
  • 15+ Built-in Rules - NotNull, NotEmpty, GreaterThan, LessThan, Between, Matches, EmailAddress, Url, CreditCard, etc.
  • Custom Rules - Synchronous and asynchronous custom validation logic
  • Error Codes - FVK### error codes for localization and structured error handling
  • Async Support - ValidateAsync for asynchronous validation scenarios
  • Collection Validation - NotEmpty, MinCount, MaxCount, RuleForEach
  • Conditional Validation - When and Unless for conditional rules
  • Cascade Modes - Continue or Stop validation on first failure
  • Nested Validation - SetValidator for complex objects
  • Localization Ready - IValidationMessageProvider for custom messages

Documentation

Full documentation available at: https://github.com/akikari/Fox.ValidationKit

License

Fox.ValidationKit is licensed under the MIT License.

Copyright (c) 2026 Karoly Akacz

Author

Karoly Akacz

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 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 is compatible.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Fox.ValidationKit:

Package Downloads
Fox.ValidationKit.ResultKit

Optional Fox.ResultKit integration for Fox.ValidationKit. Provides ValidationResult to Result conversion with fluent API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 117 2/22/2026