ZySharp.Validation 1.3.3

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package ZySharp.Validation --version 1.3.3
NuGet\Install-Package ZySharp.Validation -Version 1.3.3
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="ZySharp.Validation" Version="1.3.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZySharp.Validation --version 1.3.3
#r "nuget: ZySharp.Validation, 1.3.3"
#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 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

License: MIT Build Quality Gate Status Coverage NuGet Nuget

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 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. 
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 ZySharp.Validation:

Package Downloads
ZySharp.Progress The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Provides several extensions to the `IProgress<T>` interface as well as a fluent API to easily build progress-handler chains.

ZySharp.Metaprogramming The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A modern C# metaprogramming library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.3 164 8/4/2023
1.3.2 348 11/30/2022
1.3.1 633 11/10/2022
1.2.10 311 11/8/2022
1.2.8 390 9/23/2022
1.2.6 1,675 9/14/2022
1.2.3 12,489 8/16/2022
1.2.2 379 8/16/2022
1.2.1 398 8/5/2022
1.1.9 388 8/2/2022
1.1.8 1,128 8/2/2022
1.1.7 506 7/28/2022
1.1.6 389 7/28/2022
1.1.5 401 7/26/2022
1.1.4 925 6/29/2022
1.1.3 431 5/15/2022
1.1.2 411 5/14/2022
1.1.1 406 5/14/2022
1.1.0 445 3/2/2022
1.0.12 830 2/15/2022
1.0.11 3,721 11/2/2021
1.0.10 291 11/1/2021
1.0.9 3,060 10/5/2021
1.0.8 290 9/28/2021
1.0.7 1,809 9/13/2021
1.0.6 520 8/2/2021
1.0.5 2,300 7/9/2021
1.0.4 3,646 5/27/2021
1.0.3 349 5/3/2021
1.0.2 707 4/15/2021
1.0.1 288 4/13/2021
1.0.0 315 4/12/2021