ArgumentIntLessThanGuard.

ThrowIfIsLessOrEqualThanZero(int, string) Method

Summary

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

Syntax

public static int ThrowIfIsLessOrEqualThanZero(this int argument, string nameOfArgument)

Examples

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

var localVar = .ThrowIfIsLessOrEqualThanZero(nameof(intArgument));

Parameters

Name Type Description
argument int Argument value.
nameOfArgument string Name of the argument.

Return Value

Type Description
int
GitHub