DLoizides.Validation 1.0.1

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

Validation.Defaults

Shared FluentValidation rules and constants for FastEndpoints services.

Installation

dotnet add package DLoizides.Validation

Usage

Validation Extensions

using FluentValidation;
using Validation.Defaults.Rules;

public class CreateMenuValidator : AbstractValidator<CreateMenuRequest>
{
    public CreateMenuValidator()
    {
        RuleFor(x => x.Id).NotEmptyGuid();
        RuleFor(x => x.Name).NotEmpty().MaximumLength(ValidationLimits.MaxNameLength);
        RuleFor(x => x.Color).ValidHexColor();
        RuleFor(x => x.Url).ValidUrl();
        RuleFor(x => x.Page).ValidPageNumber();
        RuleFor(x => x.PageSize).ValidPageSize();
    }
}

Available Extensions

Extension Description
.NotEmptyGuid() Rejects Guid.Empty
.ValidHexColor() Accepts #RGB, #RRGGBB, #RRGGBBAA
.ValidUrl() Validates well-formed HTTP/HTTPS URLs
.ValidEmail() Validates email format
.ValidPageNumber() Page >= 1
.ValidPageSize() 1 ⇐ pageSize ⇐ 100
.ValidSkip() skip >= 0

Constants

using Validation.Defaults.Constants;

// Field length limits
ValidationLimits.MaxNameLength        // 200
ValidationLimits.MaxDescriptionLength // 2000
ValidationLimits.MaxUrlLength         // 2048
ValidationLimits.MaxEmailLength       // 254
ValidationLimits.MaxPhoneLength       // 20
ValidationLimits.MaxColorLength       // 9 (#RRGGBBAA)
ValidationLimits.MaxPageSize          // 100
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 (1)

Showing the top 1 NuGet packages that depend on DLoizides.Validation:

Package Downloads
Dloizides.ServiceDefaults.FastEndpoints

Add-on to Dloizides.ServiceDefaults: FastEndpoints with the house route prefix and JSON settings, plus the Keycloak OAuth2 PKCE Swagger UI served under its own docs Content-Security-Policy.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 117 11/23/2026
1.2.0 100 11/11/2026
1.1.0 252 9/27/2026
1.0.1 498 3/12/2026