ArgumentIntLessThanGuard.

ThrowIfIsLessOrEqualThan(int, int, string) Method

Summary

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

Syntax

public static int ThrowIfIsLessOrEqualThan(this int argument, int compareValue, string nameOfArgument)

Examples

Throws when the argument `intArgument` value is less or equal than 5.

var localVar = intArgument.ThrowIfIsLessOrEqualThan(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