Summary
Throws an
System.ArgumentOutOfRangeException
exception if the argument is between
compareValueStart and compareValueEnd.
- Namespace
- oehen
.arguard .Between - Containing Type
- Argument
Decimal Between Guard
Syntax
public static decimal ThrowIfIsBetween(this decimal argument, decimal compareValueStart, decimal compareValueEnd, string nameOfArgument)
Examples
Throws when the argument `decimalArgument` is between 5 and 10.
var localVar = decimalArgument.ThrowIfIsBetween(5, 10, nameof(intArgument));
Parameters
Name | Type | Description |
---|---|---|
argument | decimal | Argument value. |
compareValueStart | decimal | Start range to compare. |
compareValueEnd | decimal | End range to compare. |
nameOfArgument | string | Name of the argument. |
Return Value
Type | Description |
---|---|
decimal |