Rask.Validation.FluentValidation 0.23.1-alpha.0.429

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.429
                    
NuGet\Install-Package Rask.Validation.FluentValidation -Version 0.23.1-alpha.0.429
                    
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.429" />
                    
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.429" />
                    
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.429
                    
#r "nuget: Rask.Validation.FluentValidation, 0.23.1-alpha.0.429"
                    
#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.429
                    
#: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.429&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Validation.FluentValidation&version=0.23.1-alpha.0.429&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. Rask.Server and Rask.Wasm reference it for you, so an app has nothing to add.

  • 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.
  • Validating one root-model field, when its value arrives, 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).OnSubmit(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(ButtonType.Submit)["Order"]
]

Depends on FluentValidation 12.x.

A form needs none of this for its own rules: Input.Bind(…).Validate(v => …) is built in. Reach for this package when the rules already exist as AbstractValidator<T>, or must also run on a request.

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rask.Validation.FluentValidation:

Package Downloads
Rask.Wasm

The Rask browser host: runs a Rask app's C# components client-side on .NET WebAssembly, with the client halves of the batteries — the mediator and query cache, remote dispatch, accounts, validation and the component kit — on by default. Ships the JS boot scripts, the page shell, and the MSBuild integration that stages them into the published bundle — and, opted in, prerenders every route to static HTML with a sitemap.xml at publish, so a static host serves real pages to visitors and crawlers. Depends on Rask, the shared core.

Rask.Server

The ASP.NET host for Rask, a full-stack .NET web framework, with every battery: database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator and query cache, accounts, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, SQLite snapshots and continuous backup. Renders Rask components with live updates over a WebSocket. RaskApp.Create(args).Run<App>() is the whole Program.cs, and RaskApp.Create(args).Serve() the whole server of a WebAssembly client; app.Configure(c => c.Jobs.Off()) is how an app does without one. Depends on Rask, the shared core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.1-alpha.0.440 0 10/21/2026
0.23.1-alpha.0.437 0 10/21/2026
0.23.1-alpha.0.436 0 10/21/2026
0.23.1-alpha.0.435 31 10/20/2026
0.23.1-alpha.0.434 36 10/20/2026
0.23.1-alpha.0.432 33 10/20/2026
0.23.1-alpha.0.430 42 10/20/2026
0.23.1-alpha.0.429 35 10/20/2026
0.23.1-alpha.0.428 45 10/20/2026
0.23.1-alpha.0.427 37 10/20/2026
0.23.1-alpha.0.425 51 10/20/2026
0.23.1-alpha.0.423 39 10/20/2026
0.23.1-alpha.0.422 86 10/19/2026
0.23.1-alpha.0.421 53 10/19/2026
0.23.1-alpha.0.420 48 10/19/2026
0.23.1-alpha.0.419 47 10/19/2026
0.23.1-alpha.0.418 51 10/19/2026
0.23.1-alpha.0.415 51 10/19/2026
0.23.1-alpha.0.414 49 10/19/2026
0.23.0 114 9/18/2026
Loading failed