ZySharp.Validation
1.3.3
Prefix Reserved
dotnet add package ZySharp.Validation --version 1.3.3
NuGet\Install-Package ZySharp.Validation -Version 1.3.3
<PackageReference Include="ZySharp.Validation" Version="1.3.3" />
paket add ZySharp.Validation --version 1.3.3
#r "nuget: ZySharp.Validation, 1.3.3"
// Install ZySharp.Validation as a Cake Addin #addin nuget:?package=ZySharp.Validation&version=1.3.3 // Install ZySharp.Validation as a Cake Tool #tool nuget:?package=ZySharp.Validation&version=1.3.3
ZySharp Validation
A C# library that provides a fluent-api for basic argument validation.
Introduction
The ZySharp Validation
library is intended to replace repetitive validation/guarding code at the begin of public methods. Contrary to e.g. FluentValidation
it is not designed to validate complex entities or to report meaningful validation messages to users.
In case of a validation failure, an exception is thrown immediately without performing any further validations. The exception does always contain the root argument name as well as the complete path of the property that caused the validation to fail (e.g. assembly.Location
or ids[i]
).
Fluent API
ZySharp Validation
provides a fluent API to validate arguments:
ValidateArgument.For(args, nameof(args), v => v
.NotNull()
.NotEmpty()
...
);
Validations of sub-properties or collections are executed in separate contexts:
ValidateArgument.For(args, nameof(args), v => v
.NotNull()
.For(x => x.SubProperty, v => v // <- Switch to sub-property context
.NotEmpty()
.InRange(1, 100)
) // <- Switch back to the original context
.NotEmpty()
);
Versioning
Versions follow the semantic versioning scheme.
License
ZySharp.Validation is licensed under the MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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 was computed. 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. |
-
.NETStandard 2.0
- JetBrains.Annotations (>= 2022.3.1)
-
net6.0
- JetBrains.Annotations (>= 2022.3.1)
-
net7.0
- JetBrains.Annotations (>= 2022.3.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ZySharp.Validation:
Package | Downloads |
---|---|
ZySharp.Progress
Provides several extensions to the `IProgress<T>` interface as well as a fluent API to easily build progress-handler chains. |
|
ZySharp.Metaprogramming
A modern C# metaprogramming library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.3 | 195 | 8/4/2023 |
1.3.2 | 353 | 11/30/2022 |
1.3.1 | 634 | 11/10/2022 |
1.2.10 | 314 | 11/8/2022 |
1.2.8 | 396 | 9/23/2022 |
1.2.6 | 1,680 | 9/14/2022 |
1.2.3 | 12,581 | 8/16/2022 |
1.2.2 | 381 | 8/16/2022 |
1.2.1 | 400 | 8/5/2022 |
1.1.9 | 391 | 8/2/2022 |
1.1.8 | 1,131 | 8/2/2022 |
1.1.7 | 511 | 7/28/2022 |
1.1.6 | 391 | 7/28/2022 |
1.1.5 | 403 | 7/26/2022 |
1.1.4 | 929 | 6/29/2022 |
1.1.3 | 434 | 5/15/2022 |
1.1.2 | 413 | 5/14/2022 |
1.1.1 | 408 | 5/14/2022 |
1.1.0 | 451 | 3/2/2022 |
1.0.12 | 835 | 2/15/2022 |
1.0.11 | 3,725 | 11/2/2021 |
1.0.10 | 293 | 11/1/2021 |
1.0.9 | 3,063 | 10/5/2021 |
1.0.8 | 293 | 9/28/2021 |
1.0.7 | 1,811 | 9/13/2021 |
1.0.6 | 523 | 8/2/2021 |
1.0.5 | 2,303 | 7/9/2021 |
1.0.4 | 3,651 | 5/27/2021 |
1.0.3 | 353 | 5/3/2021 |
1.0.2 | 712 | 4/15/2021 |
1.0.1 | 294 | 4/13/2021 |
1.0.0 | 319 | 4/12/2021 |