Class Checks
Contains functions regarding checking values.
public static class Checks
- Inheritance
-
Checks
- Inherited Members
Methods
SafeEqualsEquatable<T>(T, T)
Determines whether two objects are equal using the Equals(object) method without triggering a NullReferenceException.
public static bool SafeEqualsEquatable<T>(T left, T right) where T : class?, IEquatable<T>?
Parameters
leftTThe left object to compare.
rightTThe right object to compare.
Returns
Type Parameters
TThe type of the objects to compare.
Remarks
This implementation utilizes the Equals(T) function in order to avoid the type checking overhead.
SafeEquals<T>(T, T)
Determines whether two objects are equal using the Equals(object) method without triggering a NullReferenceException.
public static bool SafeEquals<T>(T left, T right)
Parameters
leftTThe left object to compare.
rightTThe right object to compare.
Returns
Type Parameters
TThe type of the objects to compare.
Remarks
This implementation avoids using the Equals(object, object) function in order to avoid the type checking overhead.