This library provides guard clauses that could be used to guard against not expected values. It provides conditions for objects, strings, numerics, datatime and enumerables. It is possible to configure which exception should be thrown.
Helper functions to aid in argument validation for C# functions.
Example Usage:
Throw.IfNull(argument, nameof(argument));
Throw.IfNullOrEmpty(argument, nameof(argument));
This Guard utility makes it easy to validate arguments of public methods for null values or specific conditions.
It is one of the fundamentals in C# programming as enforced by static code analysis (CA1062).