![]() |
VOOZH | about |
dotnet add package Qowaiv.Validation.Fluent --version 4.1.0
NuGet\Install-Package Qowaiv.Validation.Fluent -Version 4.1.0
<PackageReference Include="Qowaiv.Validation.Fluent" Version="4.1.0" />
<PackageVersion Include="Qowaiv.Validation.Fluent" Version="4.1.0" />Directory.Packages.props
<PackageReference Include="Qowaiv.Validation.Fluent" />Project file
paket add Qowaiv.Validation.Fluent --version 4.1.0
#r "nuget: Qowaiv.Validation.Fluent, 4.1.0"
#:package Qowaiv.Validation.Fluent@4.1.0
#addin nuget:?package=Qowaiv.Validation.Fluent&version=4.1.0Install as a Cake Addin
#tool nuget:?package=Qowaiv.Validation.Fluent&version=4.1.0Install as a Cake Tool
Qowaiv provides a set of extensions on top of the FluentValidation library. It
allows to use FluentValidation in combination with Qowaiv's Result<T>.
There is a set of (generic purpose) validators to validate properties of a model.
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);
}
}
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();
}
}
The NumberValidation validates that numbers are greater/small then, or equal
to zero.
public class CustomValidator : AbstractValidator<Model>
{
public CustomValidator()
{
RuleFor(m => m.Number).IsPositive();
RuleFor(m => m.Number).IsNegative();
RuleFor(m => m.Number).IsNotPositive();
RuleFor(m => m.Number).IsNotNegative();
}
}
To have messages that use the phrasing '{PropertyName}' should be after {Value}
instead of '{PropertyName}' should be greater than {Value} makes sense for a
big range of property types, including date (time) related values.
public class CustomValidator : AbstractValidator<Model>
{
public CustomValidator()
{
RuleFor(m => m.EndDate).After(m => Clock.Today().AddYears(20));
RuleFor(m => m.EndDate).NotAfter(m => Clock.Today().AddYears(20));
RuleFor(m => m.EndDate).Before(m => Clock.Today().AddYears(20));
RuleFor(m => m.EndDate).NotBefore(m => Clock.Today().AddYears(20));
}
}
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());
}
}
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);
}
}
The NumberValidation validates that numbers are finite.
public class CustomValidator : AbstractValidator<Model>
{
public CustomValidator()
{
RuleFor(m => m.Number).IsFinite();
}
}
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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 |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.0 | 3,435 | 6/1/2026 |
| 4.0.0 | 1,098 | 5/21/2026 |
| 3.0.0 | 23,990 | 1/19/2026 |
| 2.0.0 | 49,250 | 11/19/2024 |
| 1.0.0 | 16,027 | 6/28/2024 |
| 0.3.1 | 6,266 | 3/15/2024 |
| 0.3.0 | 48,755 | 3/7/2023 |
| 0.2.1 | 21,349 | 4/13/2022 |
| 0.2.0 | 11,846 | 12/31/2021 |
| 0.1.1 | 15,378 | 9/10/2021 |
| 0.1.0 | 2,147 | 8/31/2021 |
| 0.0.7 | 5,485 | 6/4/2021 |
| 0.0.6 | 4,297 | 2/2/2021 |
| 0.0.5 | 3,494 | 7/30/2020 |
| 0.0.4 | 962 | 5/29/2020 |
| 0.0.3 | 888 | 4/9/2020 |
| 0.0.2 | 3,485 | 11/1/2019 |
| 0.0.1 | 2,007 | 7/30/2019 |
v4.1.0
- Added `IsFinite`, `IsPostive`, `IsNegative`, `IsNotPostive` and `IsNotNegative` for `INumber`.
v4.0.0
- Update to Qowaiv v8.0.0. (BREAKING)
v3.0.0
- `Before`, `After`, `NotBefore`, and `NotAfter` available for `IComparable`.
- Update to Qowaiv v7.4.7.
- Add .NET 10.0 target.
- Drop .NET standard, .NET 7.0, and .NET 9.0 targets. (BREAKING)
- Update to FluentValidation 12.1.0. (BREAKING)
v2.0.0
- Add .NET 9.0 target.
- Drop .NET 6.0 target. (BREAKING)
v1.0.0
- Drop support .NET 5.0 and .NET 7.0. (BREAKING)
- Update to Qowaiv v6.0.0.
- Update to FluentValidation v11.9.2. (BREAKING)
- ullable anotations. #48
- `InPast`, `NotInPast`, `InFuture`, and `NotInFuture` is now `Clock.UtcNow()`.
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