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