Class FormattableValidators<TResource>
- Namespace
- LfrlAnvil.Validation
- Assembly
- LfrlAnvil.Validation.dll
Creates instances of IValidator<T, TResult> type with ValidationMessage<TResource> result.
public static class FormattableValidators<TResource>
Type Parameters
TResource
Validator message's resource type.
- Inheritance
-
FormattableValidators<TResource>
- Inherited Members
Methods
ElementCountInRange<T>(int, int, ValidationMessage<TResource>)
Creates a new IsElementCountInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> ElementCountInRange<T>(int minCount, int maxCount, ValidationMessage<TResource> failureMessage)
Parameters
minCount
intMinimum expected number of elements.
maxCount
intMaximum expected number of elements.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountInRangeValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
minCount
is not in [0,maxCount
] range.
ElementCountInRange<T>(int, int, TResource)
Creates a new IsElementCountInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> ElementCountInRange<T>(int minCount, int maxCount, TResource resource)
Parameters
minCount
intMinimum expected number of elements.
maxCount
intMaximum expected number of elements.
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountInRangeValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
minCount
is not in [0,maxCount
] range.
Empty(ValidationMessage<TResource>)
Creates a new IsLengthExactValidator<TResult> instance with Length equal to 0.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> Empty(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthExactValidator<TResult> instance.
Empty(TResource)
Creates a new IsLengthExactValidator<TResult> instance with Length equal to 0.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> Empty(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthExactValidator<TResult> instance.
Empty<T>(ValidationMessage<TResource>)
Creates a new IsElementCountExactValidator<T, TResult> instance with Count equal to 0.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> Empty<T>(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
T
Element type.
Empty<T>(TResource)
Creates a new IsElementCountExactValidator<T, TResult> instance with Count equal to 0.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> Empty<T>(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
T
Element type.
EqualTo<T>(T, ValidationMessage<TResource>)
Creates a new IsEqualToValidator<T, TResult> instance with Default equality comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> EqualTo<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
EqualTo<T>(T, IEqualityComparer<T>, ValidationMessage<TResource>)
Creates a new IsEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> EqualTo<T>(T determinant, IEqualityComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IEqualityComparer<T>Value equality comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
EqualTo<T>(T, IEqualityComparer<T>, TResource)
Creates a new IsEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> EqualTo<T>(T determinant, IEqualityComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IEqualityComparer<T>Value equality comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
EqualTo<T>(T, TResource)
Creates a new IsEqualToValidator<T, TResult> instance with Default equality comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> EqualTo<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
ExactElementCount<T>(int, ValidationMessage<TResource>)
Creates a new IsElementCountExactValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> ExactElementCount<T>(int count, ValidationMessage<TResource> failureMessage)
Parameters
count
intExpected exact number of elements.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
count
is less than 0.
ExactElementCount<T>(int, TResource)
Creates a new IsElementCountExactValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> ExactElementCount<T>(int count, TResource resource)
Parameters
count
intExpected exact number of elements.
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
count
is less than 0.
ExactLength(int, ValidationMessage<TResource>)
Creates a new IsLengthExactValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> ExactLength(int length, ValidationMessage<TResource> failureMessage)
Parameters
length
intExpected exact Length.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthExactValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
length
is less than 0.
ExactLength(int, TResource)
Creates a new IsLengthExactValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> ExactLength(int length, TResource resource)
Parameters
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthExactValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
length
is less than 0.
Fail<T>(ValidationMessage<TResource>)
Creates a new FailingValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Fail<T>(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New FailingValidator<T, TResult> instance.
Type Parameters
T
Object type.
Fail<T>(TResource)
Creates a new FailingValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Fail<T>(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New FailingValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThanOrEqualTo<T>(T, ValidationMessage<TResource>)
Creates a new IsGreaterThanOrEqualToValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThanOrEqualTo<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThanOrEqualTo<T>(T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsGreaterThanOrEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThanOrEqualTo<T>(T determinant, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThanOrEqualTo<T>(T, IComparer<T>, TResource)
Creates a new IsGreaterThanOrEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThanOrEqualTo<T>(T determinant, IComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThanOrEqualTo<T>(T, TResource)
Creates a new IsGreaterThanOrEqualToValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThanOrEqualTo<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThan<T>(T, ValidationMessage<TResource>)
Creates a new IsGreaterThanValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThan<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThan<T>(T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsGreaterThanValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThan<T>(T determinant, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThan<T>(T, IComparer<T>, TResource)
Creates a new IsGreaterThanValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThan<T>(T determinant, IComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
GreaterThan<T>(T, TResource)
Creates a new IsGreaterThanValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> GreaterThan<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
InExclusiveRange<T>(T, T, ValidationMessage<TResource>)
Creates a new IsInExclusiveRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InExclusiveRange<T>(T min, T max, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InExclusiveRange<T>(T, T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsInExclusiveRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InExclusiveRange<T>(T min, T max, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InExclusiveRange<T>(T, T, IComparer<T>, TResource)
Creates a new IsInExclusiveRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InExclusiveRange<T>(T min, T max, IComparer<T> comparer, TResource resource)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InExclusiveRange<T>(T, T, TResource)
Creates a new IsInExclusiveRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InExclusiveRange<T>(T min, T max, TResource resource)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InRange<T>(T, T, ValidationMessage<TResource>)
Creates a new IsInRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InRange<T>(T min, T max, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InRange<T>(T, T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InRange<T>(T min, T max, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InRange<T>(T, T, IComparer<T>, TResource)
Creates a new IsInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InRange<T>(T min, T max, IComparer<T> comparer, TResource resource)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
InRange<T>(T, T, TResource)
Creates a new IsInRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> InRange<T>(T min, T max, TResource resource)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
LengthInRange(int, int, ValidationMessage<TResource>)
Creates a new IsLengthInRangeValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> LengthInRange(int minLength, int maxLength, ValidationMessage<TResource> failureMessage)
Parameters
minLength
intMinimum expected Length.
maxLength
intMaximum expected Length.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthInRangeValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLength
is not in [0,maxLength
] range.
LengthInRange(int, int, TResource)
Creates a new IsLengthInRangeValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> LengthInRange(int minLength, int maxLength, TResource resource)
Parameters
minLength
intMinimum expected Length.
maxLength
intMaximum expected Length.
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthInRangeValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLength
is not in [0,maxLength
] range.
LessThanOrEqualTo<T>(T, ValidationMessage<TResource>)
Creates a new IsLessThanOrEqualToValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThanOrEqualTo<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThanOrEqualTo<T>(T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsLessThanOrEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThanOrEqualTo<T>(T determinant, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThanOrEqualTo<T>(T, IComparer<T>, TResource)
Creates a new IsLessThanOrEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThanOrEqualTo<T>(T determinant, IComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThanOrEqualTo<T>(T, TResource)
Creates a new IsLessThanOrEqualToValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThanOrEqualTo<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThan<T>(T, ValidationMessage<TResource>)
Creates a new IsLessThanValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThan<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThan<T>(T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsLessThanValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThan<T>(T determinant, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThan<T>(T, IComparer<T>, TResource)
Creates a new IsLessThanValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThan<T>(T determinant, IComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
LessThan<T>(T, TResource)
Creates a new IsLessThanValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> LessThan<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
T
Object type.
Match(Regex, ValidationMessage<TResource>)
Creates a new IsRegexMatchedValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> Match(Regex regex, ValidationMessage<TResource> failureMessage)
Parameters
regex
RegexRegex to match.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsRegexMatchedValidator<TResult> instance.
Match(Regex, TResource)
Creates a new IsRegexMatchedValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> Match(Regex regex, TResource resource)
Parameters
regex
RegexRegex to match.
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsRegexMatchedValidator<TResult> instance.
MaxElementCount<T>(int, ValidationMessage<TResource>)
Creates a new MaxElementCountValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> MaxElementCount<T>(int maxCount, ValidationMessage<TResource> failureMessage)
Parameters
maxCount
intExpected maximum number of elements.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MaxElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
maxCount
is less than 0.
MaxElementCount<T>(int, TResource)
Creates a new MaxElementCountValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> MaxElementCount<T>(int maxCount, TResource resource)
Parameters
maxCount
intExpected maximum number of elements.
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MaxElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
maxCount
is less than 0.
MaxLength(int, ValidationMessage<TResource>)
Creates a new MaxLengthValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> MaxLength(int maxLength, ValidationMessage<TResource> failureMessage)
Parameters
maxLength
intExpected maximum Length.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MaxLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
maxLength
is less than 0.
MaxLength(int, TResource)
Creates a new MaxLengthValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> MaxLength(int maxLength, TResource resource)
Parameters
Returns
- IValidator<string, ValidationMessage<TResource>>
New MaxLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
maxLength
is less than 0.
MinElementCount<T>(int, ValidationMessage<TResource>)
Creates a new MinElementCountValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> MinElementCount<T>(int minCount, ValidationMessage<TResource> failureMessage)
Parameters
minCount
intExpected minimum number of elements.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
minCount
is less than 0.
MinElementCount<T>(int, TResource)
Creates a new MinElementCountValidator<T, TResult> instance.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> MinElementCount<T>(int minCount, TResource resource)
Parameters
minCount
intExpected minimum number of elements.
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
Exceptions
- ArgumentOutOfRangeException
When
minCount
is less than 0.
MinLength(int, ValidationMessage<TResource>)
Creates a new MinLengthValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> MinLength(int minLength, ValidationMessage<TResource> failureMessage)
Parameters
minLength
intExpected minimum Length.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MinLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLength
is less than 0.
MinLength(int, TResource)
Creates a new MinLengthValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> MinLength(int minLength, TResource resource)
Parameters
Returns
- IValidator<string, ValidationMessage<TResource>>
New MinLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLength
is less than 0.
NotEmpty(ValidationMessage<TResource>)
Creates a new MinLengthValidator<TResult> instance with MinLength equal to 1.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotEmpty(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MinLengthValidator<TResult> instance.
NotEmpty(TResource)
Creates a new MinLengthValidator<TResult> instance with MinLength equal to 1.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotEmpty(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MinLengthValidator<TResult> instance.
NotEmpty<T>(ValidationMessage<TResource>)
Creates a new MinElementCountValidator<T, TResult> instance with MinCount equal to 1.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> NotEmpty<T>(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
NotEmpty<T>(TResource)
Creates a new MinElementCountValidator<T, TResult> instance with MinCount equal to 1.
[Pure]
public static IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>> NotEmpty<T>(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
T
Element type.
NotEqualTo<T>(T, ValidationMessage<TResource>)
Creates a new IsNotEqualToValidator<T, TResult> instance with Default equality comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotEqualTo<T>(T determinant, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotEqualTo<T>(T, IEqualityComparer<T>, ValidationMessage<TResource>)
Creates a new IsNotEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotEqualTo<T>(T determinant, IEqualityComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
determinant
TValue to compare with.
comparer
IEqualityComparer<T>Value equality comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotEqualTo<T>(T, IEqualityComparer<T>, TResource)
Creates a new IsNotEqualToValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotEqualTo<T>(T determinant, IEqualityComparer<T> comparer, TResource resource)
Parameters
determinant
TValue to compare with.
comparer
IEqualityComparer<T>Value equality comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotEqualTo<T>(T, TResource)
Creates a new IsNotEqualToValidator<T, TResult> instance with Default equality comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotEqualTo<T>(T determinant, TResource resource)
Parameters
determinant
TValue to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotInExclusiveRange<T>(T, T, ValidationMessage<TResource>)
Creates a new IsNotInExclusiveRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInExclusiveRange<T>(T min, T max, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInExclusiveRange<T>(T, T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsNotInExclusiveRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInExclusiveRange<T>(T min, T max, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInExclusiveRange<T>(T, T, IComparer<T>, TResource)
Creates a new IsNotInExclusiveRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInExclusiveRange<T>(T min, T max, IComparer<T> comparer, TResource resource)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInExclusiveRange<T>(T, T, TResource)
Creates a new IsNotInExclusiveRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInExclusiveRange<T>(T min, T max, TResource resource)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInRange<T>(T, T, ValidationMessage<TResource>)
Creates a new IsNotInRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInRange<T>(T min, T max, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInRange<T>(T, T, IComparer<T>, ValidationMessage<TResource>)
Creates a new IsNotInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInRange<T>(T min, T max, IComparer<T> comparer, ValidationMessage<TResource> failureMessage)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
comparer
IComparer<T>Value comparer.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInRange<T>(T, T, IComparer<T>, TResource)
Creates a new IsNotInRangeValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInRange<T>(T min, T max, IComparer<T> comparer, TResource resource)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
comparer
IComparer<T>Value comparer.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotInRange<T>(T, T, TResource)
Creates a new IsNotInRangeValidator<T, TResult> instance with Default comparer.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotInRange<T>(T min, T max, TResource resource)
Parameters
min
TMinimum value to compare with.
max
TMaximum value to compare with.
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
T
Object type.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
NotMatch(Regex, ValidationMessage<TResource>)
Creates a new IsRegexNotMatchedValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotMatch(Regex regex, ValidationMessage<TResource> failureMessage)
Parameters
regex
RegexRegex to not match.
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsRegexNotMatchedValidator<TResult> instance.
NotMatch(Regex, TResource)
Creates a new IsRegexNotMatchedValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotMatch(Regex regex, TResource resource)
Parameters
regex
RegexRegex to not match.
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsRegexNotMatchedValidator<TResult> instance.
NotMultiline(ValidationMessage<TResource>)
Creates a new IsNotMultilineValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotMultiline(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsNotMultilineValidator<TResult> instance.
NotMultiline(TResource)
Creates a new IsNotMultilineValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotMultiline(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsNotMultilineValidator<TResult> instance.
NotNull<T>(ValidationMessage<TResource>)
Creates a new IsNotNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotNull<T>(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotNullValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotNull<T>(TResource)
Creates a new IsNotNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotNull<T>(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotNullValidator<T, TResult> instance.
Type Parameters
T
Object type.
NotWhiteSpace(ValidationMessage<TResource>)
Creates a new IsNotWhiteSpaceValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotWhiteSpace(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsNotWhiteSpaceValidator<TResult> instance.
NotWhiteSpace(TResource)
Creates a new IsNotWhiteSpaceValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotWhiteSpace(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsNotWhiteSpaceValidator<TResult> instance.
Null<T>(ValidationMessage<TResource>)
Creates a new IsNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Null<T>(ValidationMessage<TResource> failureMessage)
Parameters
failureMessage
ValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNullValidator<T, TResult> instance.
Type Parameters
T
Object type.
Null<T>(TResource)
Creates a new IsNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Null<T>(TResource resource)
Parameters
resource
TResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNullValidator<T, TResult> instance.
Type Parameters
T
Object type.
Pass<T>()
Creates a new PassingValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Pass<T>()
Returns
- IValidator<T, ValidationMessage<TResource>>
New PassingValidator<T, TResult> instance.
Type Parameters
T
Object type.