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.