samtrion / netevolve-guard

Basic input validation via the Requires class throws an ArgumentException, ArgumentNullException or other Exception types.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetEvolve.Guard

Basic input validation via the Requires class throws an ArgumentException, ArgumentNullException or other Exception types. The last parameter parameterName is optional and is automatically populated by .NET, based on the CallerArgumentExpressionAttribute functionality.

Requires.NotNull(arg1); // Or Requires.NotNull(arg1, nameof(arg1));
Requires.InBetween(arg1, 1, 5); // Or Requires.InBetween(arg1, 1, 5, nameof(arg1));

Experimental Package

This package NetEvolve.Guard.Experimental is based on the new .NET 6 Preview features, such as IComparisonOperators or IFloatingPoint. This replaces the single implementations for numeric type methods, this significantly reduced the packet size without loss of functionality.

Pipeline & Coverage Status

Build and Release codecov

This project is available on NuGet

NuGet package NuGet package

About

Basic input validation via the Requires class throws an ArgumentException, ArgumentNullException or other Exception types.

License:MIT License


Languages

Language:C# 100.0%