Table of Contents

Class NumericValidationExtensions

Namespace
Admonish
Assembly
Admonish.dll

Contains numeric validation extension methods of ValidationResult.

public static class NumericValidationExtensions
Inheritance
NumericValidationExtensions
Inherited Members

Methods

Between(ValidationResult, string, decimal, decimal, decimal, string?)

Ensures that the specified number is within the specified range (inclusive). When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Between(this ValidationResult r, string key, decimal value, decimal minValue, decimal maxValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value decimal

The number to check.

minValue decimal

The minimum allowed value.

maxValue decimal

The maximum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Between(ValidationResult, string, int, int, int, string?)

Ensures that the specified number is within the specified range (inclusive). When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Between(this ValidationResult r, string key, int value, int minValue, int maxValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value int

The number to check.

minValue int

The minimum allowed value.

maxValue int

The maximum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Max(ValidationResult, string, decimal, decimal, string?)

Ensures that the specified number is less than or equal to the specified value. When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Max(this ValidationResult r, string key, decimal value, decimal maxValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value decimal

The number to check.

maxValue decimal

The maximum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Max(ValidationResult, string, int, int, string?)

Ensures that the specified number is less than or equal to the specified value. When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Max(this ValidationResult r, string key, int value, int maxValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value int

The number to check.

maxValue int

The maximum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Min(ValidationResult, string, decimal, decimal, string?)

Ensures that the specified number is greater than or equal to the specified value. When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Min(this ValidationResult r, string key, decimal value, decimal minValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value decimal

The number to check.

minValue decimal

The minimum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Min(ValidationResult, string, int, int, string?)

Ensures that the specified number is greater than or equal to the specified value. When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult Min(this ValidationResult r, string key, int value, int minValue, string? message = null)

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value int

The number to check.

minValue int

The minimum allowed value.

message string

An optional error message.

Returns

ValidationResult

The validation result.