ArgumentIntLessThanGuard.

ThrowIfIsLessThan(int, int, string) Method

Summary

Throws an System.ArgumentOutOfRangeException exception if the argument is less than compareValue.

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
GitHub