ReValidator 1.0.1

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

ReValidator

ReValidator provides runtime-reconfigurable validation for .NET applications.

Unlike traditional validation frameworks that rely on static rule definitions or reflection-heavy execution, ReValidator uses compiled expression trees, achieving performance close to statically defined validation rules while preserving full runtime flexibility.

This makes ReValidator well-suited for scenarios where validation rules must be modified without redeploying the application (e.g. configuration-driven systems, rule engines, multi-tenant platforms).


Features

  • Runtime configuration of validation rules
  • Near-static execution performance using compiled expressions
  • No reflection during validation execution
  • Standard IValidator<T> integration
  • Dependency Injection friendly
  • Support for reusable helper methods in expressions

Installation

Install via NuGet:

dotnet add package ReValidator

Or via the NuGet Package Manager:

Install-Package ReValidator

Getting Started

Dependency Injection

Enable ReValidator by registering it in the service container:

services.AddReValidator();

This registers the IValidator<T> interface and all required internal services.


Registering helper methods

If your validation expressions depend on reusable helper methods, you can register them explicitly:

using ReValidator;

services.AddReValidator(options =>
{
    options.RegisterType<Helpers>();
});

Registered types become available for use inside validation expressions.


Defining validation rules

Validation rules can be added or updated at runtime:

using ReValidator;

services.ApplyReconfiguration(
    new DynamicReconfiguration
    {
        RuleName = "FullNameRequired",
        PropertyName = "Name",
        ErrorMessage = "The \"{PropertyName}\" is required",
        Expression = "x => !string.IsNullOrWhiteSpace(x.Name)",
        FullPathToModel = typeof(Person).FullName
    });

Rule properties

Property Description
RuleName Unique rule identifier
PropertyName Target model property
ErrorMessage Validation error message
Expression Validation logic as an expression string
FullPathToModel Fully qualified model type name

Consuming the validator

Inject and use the validator via the standard IValidator<T> interface:

using ReValidator;

public class MyClass
{
    private readonly IValidator<Person> _validator;

    public MyClass(IValidator<Person> validator)
    {
        _validator = validator;
    }
}

Validation usage

Validate an input model as follows:

var validationResult = validator.Validate(model);

if (!validationResult.IsValid)
{
    _logger.LogInformation(
        "Validation failed: " +
        string.Join("; ",
            validationResult.Errors.Select(x =>
                $"{x.PropertyName}: {string.Join(", ", x.ErrorMessages)}"))
    );
}

Performance considerations

  • Validation expressions are compiled once and cached
  • No reflection is used during validation execution
  • Execution speed is comparable to statically coded validation rules
  • Runtime reconfiguration does not require application restart

Limitations

  • Validation expressions must be valid C# expressions
  • Only members available on the target model and registered helper types can be accessed
  • Expression parsing errors surface during configuration, not execution

Packages

  • ReValidator.Contracts – Shared contracts and abstractions
  • ReValidator – Core validation engine and DI integration

Compatibility

  • netstandard 2.1
  • ASP.NET Core
  • Console applications
  • Background services

License

This project is licensed under the MIT License.


Note: ReValidator is a .NET-specific validation library and is not related to JavaScript or JSON Schema validators with similar names.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ReValidator:

Package Downloads
ReValidator.BlazorAdapter

ReValidator.BlazorAdapter integrates the ReValidator validation library with Blazor's EditForm system. Drop ReValidatorComponent<TModel> inside any EditForm to get model and field-level validation powered by ReValidator, with full dependency-injection support. Includes ServerValidationInterop for merging RFC 7807 server-side validation errors into the client form.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 114 12/28/2025
1.0.0 186 12/22/2025