FluentAnnotationsValidator.Runtime 2.0.0-rc.1.0.0

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

FluentAnnotationsValidator.Runtime

FluentAnnotationsValidator.Runtime is the execution engine of the FluentAnnotationsValidator ecosystem. It powers dynamic validation pipelines by discovering attributes, composing rules, and executing validations at runtime. Designed for extensibility, localization, and seamless integration with dependency injection, this package is ideal for building culture-aware, fluent validation systems in .NET.


What It Does

  • Attribute Discovery
    Parses [ValidationAttribute] and custom annotations like MustAttribute, ComparisonAttribute, and CollectionValidationAttribute.

  • Rule Composition
    Builds validation rules dynamically using interfaces like IValidationRuleBuilder, IValidationRuleGroup, and IFluentTypeValidator.

  • Localization Support
    Resolves localized error messages via StringLocalizerFactoryResult and TypeUtils.

  • Runtime Configuration
    Configurable via ConfigurationOptions, with support for fluent overrides, async rules, and conditional logic.


Installation

dotnet add package FluentAnnotationsValidator.Runtime

Project Structure

Annotations

Custom runtime attributes for advanced validation scenarios:

  • MustAttribute – Inline predicate-based validation
  • ComparisonAttribute – Cross-property comparison with operators
  • CollectionAttribute, CollectionAsyncAttribute – Collection-level rules
  • AsyncValidationAttribute – Asynchronous validation support
Extensions

Fluent APIs for rule composition and validator access:

  • FluentTypeValidatorExtensions
  • ValidationRuleBuilderExtensions
Interfaces

Core abstractions for validators, rule groups, and configurators:

  • IFluentTypeValidator, IFluentTypeValidatorRoot
  • IValidationRuleBuilder, IValidationRuleGroup, IValidationRuleGroupRegistry
  • IValidationConfigurator, IValidationTypeConfigurator
  • ICollectionRule, IValidationRuleInternal
Core Components
  • FluentTypeValidator, FluentTypeValidatorRoot – Central runtime validators
  • ValidationRule, ValidationRule<T> – Rule definitions
  • ValidationRuleBuilder – Fluent rule construction
  • ValidationRuleGroup, ValidationRuleGroupList, ValidationRuleGroupRegistry – Rule grouping and registry
  • PendingRule – Deferred rule resolution
  • RuleDefinitionBehavior – Controls rule discovery behavior
  • FluentValidationException – Exception for validation failures
  • TypeUtils – Reflection and localization helpers
  • ConfigurationOptions – DI and runtime configuration
  • FluentAnnotationsBuilder – Entry point for configuring validation services

Getting Started

services.AddFluentAnnotationsValidators(options =>
{
    options.ExtraValidatableTypesFactory = () => [typeof(MyModel)];
    options.ConfigureLocalization = loc => loc.ResourcesPath = "Resources";
});
var validator = serviceProvider.GetRequiredService<IFluentValidator<MyModel>>();
var result = validator.Validate(new MyModel());

Advanced Features

  • Conditional rule activation
  • Async validation support
  • Culture-aware error messages
  • Fluent overrides for [ValidationAttribute]
  • Extensible rule registry for custom scenarios


License

MIT


Contributing

We welcome contributions! Please see the contributor guide for details.

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 (1)

Showing the top 1 NuGet packages that depend on FluentAnnotationsValidator.Runtime:

Package Downloads
FluentAnnotationsValidator

A fluent, culture-aware validation library for .NET. Automatically transforms [ValidationAttribute] annotations into runtime rules, with support for conditional logic, error localization, and developer-friendly configuration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-rc.1.0.0 80 10/4/2025