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