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