Summary
Throws an
ArgumentOutOfRangeException exception if the argument is less or equal
than compareValue.
- Namespace
- oehen
.arguard .LessThan - Containing Type
- Argument
Int Less Than Guard
Syntax
public static int ThrowIfIsLessOrEqualThan(this int argument, int compareValue, string nameOfArgument)
Examples
Throws when the argument `intArgument` value is less or equal than 5.
var localVar = intArgument.ThrowIfIsLessOrEqualThan(nameof(intArgument), 5);
Parameters
| Name | Type | Description |
|---|---|---|
| argument | int | Argument value. |
| compareValue | int | Value to compare. |
| nameOfArgument | string | Name of the argument. |
Return Value
| Type | Description |
|---|---|
| int |