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