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