Rask.Validation.FluentValidation 0.23.1-alpha.0.45

This is a prerelease version of Rask.Validation.FluentValidation.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Rask.Validation.FluentValidation --version 0.23.1-alpha.0.45
                    
NuGet\Install-Package Rask.Validation.FluentValidation -Version 0.23.1-alpha.0.45
                    
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="Rask.Validation.FluentValidation" Version="0.23.1-alpha.0.45" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.Validation.FluentValidation" Version="0.23.1-alpha.0.45" />
                    
Directory.Packages.props
<PackageReference Include="Rask.Validation.FluentValidation" />
                    
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 Rask.Validation.FluentValidation --version 0.23.1-alpha.0.45
                    
#r "nuget: Rask.Validation.FluentValidation, 0.23.1-alpha.0.45"
                    
#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 Rask.Validation.FluentValidation@0.23.1-alpha.0.45
                    
#: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=Rask.Validation.FluentValidation&version=0.23.1-alpha.0.45&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Validation.FluentValidation&version=0.23.1-alpha.0.45&prerelease
                    
Install as a Cake Tool

Rask.Validation.FluentValidation

FluentValidation for Rask forms and requests, in Rask, a full-stack .NET web framework for teams of any size. The Rask package references it for you on both the server and the browser.

  • Writing the validator is the registration. A generator finds every AbstractValidator<T> in the app at compile time, and a form asks for the one that validates its model — nothing to declare in the form, nothing to wire in Program.cs.
  • No assembly scan. Registration is emitted as a [ModuleInitializer], so a WebAssembly app uses FluentValidation and still publishes trimmed.
  • Async rules work like sync ones. Each validator is wrapped as an IAsyncFieldValidator, so a MustAsync uniqueness check runs per field; a validator with constructor dependencies is resolved from the scope.
  • Per-keystroke validation of a root-model field runs only that property's rules; submit runs every rule.
  • A validator in a referenced class library is registered explicitly: RaskValidators.Register(typeof(Order), _ => new OrderValidator());

Install

dotnet add package Rask.Validation.FluentValidation

Use

public sealed class OrderValidator : AbstractValidator<OrderModel>
{
    public OrderValidator()
    {
        RuleFor(x => x.Product).NotEmpty();
        RuleFor(x => x.Quantity).GreaterThanOrEqualTo(1).WithMessage("Quantity must be at least 1.");
    }
}
Form.Model(_model).OnValidSubmit(m => _submission = "Ordered")[
    Input.Bind(() => _model.Product),
    Validation.Message.Template(errors => Span.Class("error")[errors[0]]).For(() => _model.Product),
    Input.Bind(() => _model.Quantity),
    Validation.Message.Template(errors => Span.Class("error")[errors[0]]).For(() => _model.Quantity),
    Button.Type("submit")["Order"]
]

Depends on FluentValidation 12.x.

Guides: Validation · Forms — validation

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
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 Rask.Validation.FluentValidation:

Package Downloads
Rask

The one reference a Rask application needs, server or browser. On a server target (net10.0 or net11.0) it brings the ASP.NET host plus every battery — database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On a browser target it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.1-alpha.0.64 0 9/24/2026
0.23.1-alpha.0.62 0 9/24/2026
0.23.1-alpha.0.61 0 9/24/2026
0.23.1-alpha.0.50 0 9/24/2026
0.23.1-alpha.0.49 0 9/24/2026
0.23.1-alpha.0.48 0 9/24/2026
0.23.1-alpha.0.47 0 9/24/2026
0.23.1-alpha.0.46 32 9/23/2026
0.23.1-alpha.0.45 28 9/23/2026
0.23.1-alpha.0.43 33 9/23/2026
0.23.1-alpha.0.38 32 9/23/2026
0.23.1-alpha.0.36 35 9/23/2026
0.23.1-alpha.0.35 30 9/23/2026
0.23.1-alpha.0.34 34 9/23/2026
0.23.1-alpha.0.33 48 9/21/2026
0.23.1-alpha.0.30 42 9/21/2026
0.23.1-alpha.0.29 42 9/21/2026
0.23.1-alpha.0.28 49 9/21/2026
0.23.1-alpha.0.27 51 9/21/2026
0.23.0 90 9/18/2026
Loading failed