Qowaiv.Validation.Fluent
2.0.0
dotnet add package Qowaiv.Validation.Fluent --version 2.0.0
NuGet\Install-Package Qowaiv.Validation.Fluent -Version 2.0.0
<PackageReference Include="Qowaiv.Validation.Fluent" Version="2.0.0" />
paket add Qowaiv.Validation.Fluent --version 2.0.0
#r "nuget: Qowaiv.Validation.Fluent, 2.0.0"
// Install Qowaiv.Validation.Fluent as a Cake Addin #addin nuget:?package=Qowaiv.Validation.Fluent&version=2.0.0 // Install Qowaiv.Validation.Fluent as a Cake Tool #tool nuget:?package=Qowaiv.Validation.Fluent&version=2.0.0
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 | 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 is compatible. |
.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. |
-
.NETStandard 2.0
- FluentValidation (>= 11.10.0)
- Qowaiv (>= 7.2.0)
- Qowaiv.Validation.Abstractions (>= 1.0.0)
-
net8.0
- FluentValidation (>= 11.10.0)
- Qowaiv (>= 7.2.0)
- Qowaiv.Validation.Abstractions (>= 1.0.0)
-
net9.0
- FluentValidation (>= 11.10.0)
- Qowaiv (>= 7.2.0)
- Qowaiv.Validation.Abstractions (>= 1.0.0)
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 |
---|---|---|
2.0.0 | 193 | 11/19/2024 |
1.0.0 | 8,500 | 6/28/2024 |
0.3.1 | 6,080 | 3/15/2024 |
0.3.0 | 36,534 | 3/7/2023 |
0.2.1 | 20,422 | 4/13/2022 |
0.2.0 | 11,595 | 12/31/2021 |
0.1.1 | 15,022 | 9/10/2021 |
0.1.0 | 1,890 | 8/31/2021 |
0.0.7 | 5,210 | 6/4/2021 |
0.0.6 | 4,052 | 2/2/2021 |
0.0.5 | 3,269 | 7/30/2020 |
0.0.4 | 725 | 5/29/2020 |
0.0.3 | 640 | 4/9/2020 |
0.0.2 | 3,210 | 11/1/2019 |
0.0.1 | 1,664 | 7/30/2019 |
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 v8.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