PineGuard.FluentValidation
0.1.0-alpha.7
dotnet add package PineGuard.FluentValidation --version 0.1.0-alpha.7
NuGet\Install-Package PineGuard.FluentValidation -Version 0.1.0-alpha.7
<PackageReference Include="PineGuard.FluentValidation" Version="0.1.0-alpha.7" />
<PackageVersion Include="PineGuard.FluentValidation" Version="0.1.0-alpha.7" />
<PackageReference Include="PineGuard.FluentValidation" />
paket add PineGuard.FluentValidation --version 0.1.0-alpha.7
#r "nuget: PineGuard.FluentValidation, 0.1.0-alpha.7"
#:package PineGuard.FluentValidation@0.1.0-alpha.7
#addin nuget:?package=PineGuard.FluentValidation&version=0.1.0-alpha.7&prerelease
#tool nuget:?package=PineGuard.FluentValidation&version=0.1.0-alpha.7&prerelease
PineGuard.FluentValidation
Already using FluentValidation? Don't rewrite your rules in a second dialect.
PineGuard.FluentValidation exposes every PineGuard rule as an IRuleBuilder extension — .Email(), .HttpsUrl(), .OwaspSafe(), and the rest — so AbstractValidator<T> reads exactly the way you expect. Same rule library as Must and Guard, same answer every time.
FluentValidation is the .NET idiom for request, command, and DTO validation — application requests, MediatR commands, ASP.NET Core models, and anywhere your pipeline needs a validator. It's a perfect fit for Clean Architecture, where the always-valid-state principle holds at the Application boundary: put your AbstractValidator<T> in the Application layer, run it before the handler, and nothing reaches your domain model that hasn't been cleaned first.
One rule library. Every call site in your architecture. The same Must.Be.Email your services call and the same Guard.Against.NotEmail your domain constructors call power RuleFor(x => x.Email).Email() in your validator. No parallel dialects. No drift. When the rule changes, every layer changes with it.
Install
dotnet add package PineGuard.FluentValidation
Targets net8.0, net10.0, and netstandard2.1. Depends on PineGuard.Core, PineGuard.MustClauses, and FluentValidation.
Examples
using FluentValidation;
using PineGuard.FluentValidation;
public sealed class CreateUserRequestValidator : AbstractValidator<CreateUserRequest>
{
public CreateUserRequestValidator()
{
// The four canonical rules, as IRuleBuilder extensions
RuleFor(x => x.Email).Required().Email();
RuleFor(x => x.StrictEmailAddress).Required().StrictEmail();
RuleFor(x => x.UserInput).Required().OwaspSafe();
RuleFor(x => x.Callback).Required().HttpsUrl();
}
}
Chain with FluentValidation's built-ins
PineGuard extensions compose with every FluentValidation API — .WithMessage(), .When(), .NotEmpty(), .MaximumLength(), and the rest — so you can stack PineGuard rules alongside length limits, conditional checks, and custom error messages on a single property.
RuleFor(x => x.Website)
.Required()
.HttpsUrl()
.MaximumLength(256)
.WithMessage("Website must be an HTTPS URL no longer than 256 characters.");
RuleFor(x => x.CompanyEmail)
.Required()
.StrictEmail()
.When(x => x.IsCorporateUser);
RuleFor(x => x.Bio)
.NotEmpty()
.MaximumLength(500)
.OwaspSafe();
A note on naming
FluentValidation already defines .NotNull() and .Null(). PineGuard uses .Required() / .NotRequired() for presence checks so the two libraries never collide. Every other rule keeps its natural name.
Other layers, same rule library
- Constructors and service boundaries → PineGuard.GuardClauses
- Result-based, composable validation → PineGuard.MustClauses
- Attribute-driven models → PineGuard.DataAnnotations
See the full documentation for the complete extension-method catalog.
License
MIT © Steve McCormack
| Product | Versions 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 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 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. |
| .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. |
-
.NETStandard 2.1
- FluentValidation (>= 11.12.0)
- PineGuard.Core (>= 0.1.0-alpha.7)
- PineGuard.MustClauses (>= 0.1.0-alpha.7)
-
net10.0
- FluentValidation (>= 11.12.0)
- PineGuard.Core (>= 0.1.0-alpha.7)
- PineGuard.MustClauses (>= 0.1.0-alpha.7)
-
net8.0
- FluentValidation (>= 11.12.0)
- PineGuard.Core (>= 0.1.0-alpha.7)
- PineGuard.MustClauses (>= 0.1.0-alpha.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.7 | 188 | 4/20/2026 |
| 0.1.0-alpha.6 | 66 | 4/20/2026 |
| 0.1.0-alpha.5 | 80 | 4/18/2026 |