ArgumentDecimalLessThanGuard.

ThrowIfIsLessThanZero(decimal, string) Method

Summary

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

Syntax

public static decimal ThrowIfIsLessThanZero(this decimal argument, string nameOfArgument)

Examples

Throws when the decimal argument `decimalArgument` is less than 0.

var localVar = decimalArgument.ThrowIfIsLessThanZero(nameof(decimalArgument));

Parameters

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

Return Value

Type Description
decimal
GitHub