Qowaiv.Validation.Fluent 0.3.1

dotnet add package Qowaiv.Validation.Fluent --version 0.3.1
NuGet\Install-Package Qowaiv.Validation.Fluent -Version 0.3.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="Qowaiv.Validation.Fluent" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Qowaiv.Validation.Fluent --version 0.3.1
#r "nuget: Qowaiv.Validation.Fluent, 0.3.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.
// Install Qowaiv.Validation.Fluent as a Cake Addin
#addin nuget:?package=Qowaiv.Validation.Fluent&version=0.3.1

// Install Qowaiv.Validation.Fluent as a Cake Tool
#tool nuget:?package=Qowaiv.Validation.Fluent&version=0.3.1

Qowaiv exensions on *Fluent Validation

Validators

Required

The RequiredValidation validates that a required property has a set value. If specified, an unknown value can be seen as a set value, by default it is not.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.Email).Required();
        RuleFor(m => m.Iban).Required(allowUnknown: true);
    }
}

Not unknown

The UnknownValidation validates that a value does not equal the Unknown value (if existing of course). Accessible via the fluent syntax.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.Email).NotEmptyOrUnknown();
        RuleFor(m => m.Iban).NotUnknown();
    }
}

Relative to the clock

The ClockValidation validates if a date (time) is in the past, or future. It supports Date, DateTime, Date?, and DateTime?, and the provision of custom date (time) provider. By Default, Clock.Now() and Clock.Today() are used.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.Date1).InFuture();
        RuleFor(m => m.Date2).InPast();
        RuleFor(m => m.Date3).NotInFuture();
        RuleFor(m => m.Date4).NotInPast(() => CustomeDateProvider());
    }
}

Postal code valid for specific country

The PostalCodeValidation validates that a PostalCode value is valid for a specific Country, both static and via another property.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.PostalCode).ValidFor(m => m.Country);
    }
}

Finite floating points

The FloatingPointValidation validates that double and float values are finite numbers.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.Number).IsFinite();
    }
}

Email address should not be IP-based

The EmailAddressValidation validates that an EmailAddress does not have an IP-based domain.

public class CustomValidator : AbstractValidator<Model>
{
    public CustomValidator()
    {
        RuleFor(m => m.Email).NotIPBased();
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 Qowaiv.Validation.Fluent:

Package Downloads
Qowaiv.Validation.TestTools

Qowaiv Validation supports a generic interface for (domain) model validation.

Pmdevers.Common

Common boilerplate code for MinimalAPI Microservice

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.1 1,514 3/15/2024
0.3.0 28,653 3/7/2023
0.2.1 19,717 4/13/2022
0.2.0 11,552 12/31/2021
0.1.1 14,809 9/10/2021
0.1.0 1,848 8/31/2021
0.0.7 5,019 6/4/2021
0.0.6 4,005 2/2/2021
0.0.5 3,232 7/30/2020
0.0.4 694 5/29/2020
0.0.3 617 4/9/2020
0.0.2 3,155 11/1/2019
0.0.1 1,613 7/30/2019

v0.3.1
- FIx so that Required to be current culture dependent. #74
- `.IsFinite()` for doubles and floats.
v0.3.0
- Support .NET 7.0. #62
v0.2.1
- Nullable anotations. #48
- , `InPast`, `NotInPast`, `InFuture`, and `NotInFuture` available for `DateOnly`. #49
v0.2.0
- Updated Qowaiv dependency.
v0.1.1
- Decorate pure methods with attribute. #38
v0.1.0
- Qowaiv.Validation.Abstractions dependency.
v0.0.7
- Update to FluentValidation v10.2.0.
v0.0.6
- ModelValidator instead of FluentModelValidator. #18
- Drop FluentValidator. #19
- Required with allow unknown is one rule now. #19 (fix)
v0.0.5
- Update to FluentValidation v9.0.1
v0.0.4
- Support `SetSeverity` and `WithMessage` on `NotEmptyOrUnknown`. #12 (fix)
v0.0.3
- Added `Required()`. #4
- Severity taken into account. #5 (fix)
v0.0.2
- Added Guards for null
v0.0.1
- Initial version