Method ArgumentIsNotNegative
ArgumentIsNotNegative<T>(Expression<Func<T>>)
Verifies the expression
is not a negative number and throws an
ArgumentOutOfRangeException if it is a negative number.
Declaration
public static void ArgumentIsNotNegative<T>(Expression<Func<T>> expression) where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<T>> | expression | An expression containing a single parameter e.g. () => param |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The |
ArgumentIsNotNegative<T>(T, string)
Checks if argumentValue
is not a negative number.
Declaration
public static void ArgumentIsNotNegative<T>(T argumentValue, string argumentName) where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
T | argumentValue | The value to verify. |
string | argumentName | The name of the |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The |