Class ComparisonExtensions
- Namespace
- Acuit.Pinpoint.Workflows.Validation
- Assembly
- Acuit.Pinpoint.Workflows.dll
Comparison argument validation extensions.
public static class ComparisonExtensions
- Inheritance
-
ComparisonExtensions
- Inherited Members
Methods
IsGreaterThanOrEqualTo<T>(ArgumentValidator<T?>, T)
Validates that an argument value is greater than or equal to a value.
public static ArgumentValidator<T?> IsGreaterThanOrEqualTo<T>(this ArgumentValidator<T?> validator, T value) where T : struct, IComparable<T>
Parameters
validator
ArgumentValidator<T?>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T?>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not greater than or equal to
value
.
IsGreaterThanOrEqualTo<T>(ArgumentValidator<T>, T)
Validates that an argument value is greater than or equal to a value.
public static ArgumentValidator<T> IsGreaterThanOrEqualTo<T>(this ArgumentValidator<T> validator, T value) where T : IComparable<T>
Parameters
validator
ArgumentValidator<T>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not greater than or equal to
value
.
IsGreaterThan<T>(ArgumentValidator<T?>, T)
Validates that an argument value is greater than a value.
public static ArgumentValidator<T?> IsGreaterThan<T>(this ArgumentValidator<T?> validator, T value) where T : struct, IComparable<T>
Parameters
validator
ArgumentValidator<T?>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T?>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not greater than
value
.
IsGreaterThan<T>(ArgumentValidator<T>, T)
Validates that an argument value is greater than a value.
public static ArgumentValidator<T> IsGreaterThan<T>(this ArgumentValidator<T> validator, T value) where T : IComparable<T>
Parameters
validator
ArgumentValidator<T>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not greater than
value
.
IsInRangeInclusive<T>(ArgumentValidator<T?>, T, T)
Validates that an argument value is within a specified range.
public static ArgumentValidator<T?> IsInRangeInclusive<T>(this ArgumentValidator<T?> validator, T minimum, T maximum) where T : struct, IComparable<T>
Parameters
validator
ArgumentValidator<T?>The validator.
minimum
TThe minimum acceptable value.
maximum
TThe maximum acceptable value.
Returns
- ArgumentValidator<T?>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not within the specified range.
IsInRangeInclusive<T>(ArgumentValidator<T>, T, T)
Validates that an argument value is within a specified range.
public static ArgumentValidator<T> IsInRangeInclusive<T>(this ArgumentValidator<T> validator, T minimum, T maximum) where T : IComparable<T>
Parameters
validator
ArgumentValidator<T>The validator.
minimum
TThe minimum acceptable value.
maximum
TThe maximum acceptable value.
Returns
- ArgumentValidator<T>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not within the specified range.
IsLessThanOrEqualTo<T>(ArgumentValidator<T?>, T)
Validates that an argument value is greater than or equal to a value.
public static ArgumentValidator<T?> IsLessThanOrEqualTo<T>(this ArgumentValidator<T?> validator, T value) where T : struct, IComparable<T>
Parameters
validator
ArgumentValidator<T?>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T?>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not less than or equal to
value
.
IsLessThanOrEqualTo<T>(ArgumentValidator<T>, T)
Validates that an argument value is greater than or equal to a value.
public static ArgumentValidator<T> IsLessThanOrEqualTo<T>(this ArgumentValidator<T> validator, T value) where T : IComparable<T>
Parameters
validator
ArgumentValidator<T>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not less than or equal to
value
.
IsLessThan<T>(ArgumentValidator<T?>, T)
Validates that an argument value is less than a value.
public static ArgumentValidator<T?> IsLessThan<T>(this ArgumentValidator<T?> validator, T value) where T : struct, IComparable<T>
Parameters
validator
ArgumentValidator<T?>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T?>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not less than
value
.
IsLessThan<T>(ArgumentValidator<T>, T)
Validates that an argument value is less than a value.
public static ArgumentValidator<T> IsLessThan<T>(this ArgumentValidator<T> validator, T value) where T : IComparable<T>
Parameters
validator
ArgumentValidator<T>The validator.
value
TThe value to which to compare the argument value.
Returns
- ArgumentValidator<T>
The
validator
instance to support chaining.
Type Parameters
T
The value type.
Exceptions
- ArgumentNullException
validator
is null.- InvalidOperationException
The argument value is not less than
value
.