Skip to content
Artem Kirgizov edited this page May 31, 2021 · 5 revisions
Namespace: Toolkit.Contracts

Check - a static class similar to the Contract class, but returns a Boolean value instead of throwing an exception. Useful in places where you need to reduce the code due to a single place verification.

The main features of the class:

object obj = new object();
if (Check.NotNull<object>(obj)) // true if obj isn't null
{
}
int first = 5;
int second = 5;
if (Check.NotMoreOrEqual(first, second)) // true if first is not more and not equal than second
{
}
string str = "";
if (Check.StringFilled(str)) // false because str is empty
{
}
  • And others