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
TResourceValidator 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
minCountintMinimum expected number of elements.
maxCountintMaximum expected number of elements.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountInRangeValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
minCountis 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
minCountintMinimum expected number of elements.
maxCountintMaximum expected number of elements.
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountInRangeValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
minCountis 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
failureMessageValidationMessage<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
resourceTResourceFailure 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
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
TElement 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
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
TElement 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIEqualityComparer<T>Value equality comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIEqualityComparer<T>Value equality comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
countintExpected exact number of elements.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
countis 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
countintExpected exact number of elements.
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New IsElementCountExactValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
countis 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
lengthintExpected exact Length.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthExactValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
lengthis 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
lengthis 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
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New FailingValidator<T, TResult> instance.
Type Parameters
TObject type.
Fail<T>(TResource)
Creates a new FailingValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Fail<T>(TResource resource)
Parameters
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New FailingValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsGreaterThanValidator<T, TResult> instance.
Type Parameters
TObject 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minLengthintMinimum expected Length.
maxLengthintMaximum expected Length.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthInRangeValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLengthis 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
minLengthintMinimum expected Length.
maxLengthintMaximum expected Length.
resourceTResourceFailure resource.
Returns
- IValidator<string, ValidationMessage<TResource>>
New IsLengthInRangeValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLengthis 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanOrEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsLessThanValidator<T, TResult> instance.
Type Parameters
TObject 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
regexRegexRegex to match.
failureMessageValidationMessage<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
regexRegexRegex to match.
resourceTResourceFailure 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
maxCountintExpected maximum number of elements.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MaxElementCountValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
maxCountis 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
maxCountintExpected maximum number of elements.
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MaxElementCountValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
maxCountis 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
maxLengthintExpected maximum Length.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MaxLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
maxLengthis 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
maxLengthis 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
minCountintExpected minimum number of elements.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
minCountis 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
minCountintExpected minimum number of elements.
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
TElement type.
Exceptions
- ArgumentOutOfRangeException
When
minCountis 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
minLengthintExpected minimum Length.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<string, ValidationMessage<TResource>>
New MinLengthValidator<TResult> instance.
Exceptions
- ArgumentOutOfRangeException
When
minLengthis 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
minLengthis 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
failureMessageValidationMessage<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
resourceTResourceFailure 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
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
TElement 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
resourceTResourceFailure resource.
Returns
- IValidator<IReadOnlyCollection<T>, ValidationMessage<TResource>>
New MinElementCountValidator<T, TResult> instance.
Type Parameters
TElement 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
determinantTValue to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIEqualityComparer<T>Value equality comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
comparerIEqualityComparer<T>Value equality comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
determinantTValue to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotEqualToValidator<T, TResult> instance.
Type Parameters
TObject 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum exclusive value to compare with.
maxTMaximum exclusive value to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInExclusiveRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
comparerIComparer<T>Value comparer.
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
comparerIComparer<T>Value comparer.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
minTMinimum value to compare with.
maxTMaximum value to compare with.
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotInRangeValidator<T, TResult> instance.
Type Parameters
TObject type.
Exceptions
- ArgumentOutOfRangeException
When
minis 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
regexRegexRegex to not match.
failureMessageValidationMessage<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
regexRegexRegex to not match.
resourceTResourceFailure 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
failureMessageValidationMessage<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
resourceTResourceFailure 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
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotNullValidator<T, TResult> instance.
Type Parameters
TObject type.
NotNull<T>(TResource)
Creates a new IsNotNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> NotNull<T>(TResource resource)
Parameters
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNotNullValidator<T, TResult> instance.
Type Parameters
TObject type.
NotWhiteSpace(ValidationMessage<TResource>)
Creates a new IsNotWhiteSpaceValidator<TResult> instance.
[Pure]
public static IValidator<string, ValidationMessage<TResource>> NotWhiteSpace(ValidationMessage<TResource> failureMessage)
Parameters
failureMessageValidationMessage<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
resourceTResourceFailure 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
failureMessageValidationMessage<TResource>Failure message.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNullValidator<T, TResult> instance.
Type Parameters
TObject type.
Null<T>(TResource)
Creates a new IsNullValidator<T, TResult> instance.
[Pure]
public static IValidator<T, ValidationMessage<TResource>> Null<T>(TResource resource)
Parameters
resourceTResourceFailure resource.
Returns
- IValidator<T, ValidationMessage<TResource>>
New IsNullValidator<T, TResult> instance.
Type Parameters
TObject 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
TObject type.