ArgumentDecimalLessThanGuard.

ThrowIfIsLessThan(decimal, decimal, string) Method

Summary

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

Syntax

public static decimal ThrowIfIsLessThan(this decimal argument, decimal compareValue, string nameOfArgument)

Examples

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

var localVar = decimalArgument.ThrowIfIsLessThan(nameof(decimalArgument), 5);

Parameters

Name Type Description
argument decimal Argument value.
compareValue decimal Value to compare.
nameOfArgument string Name of the argument.

Return Value

Type Description
decimal
GitHub