Class MinLengthValidator<TResult>
- Namespace
- LfrlAnvil.Validation.Validators
- Assembly
- LfrlAnvil.Validation.dll
public sealed class MinLengthValidator<TResult> : IValidator<string, TResult>
Type Parameters
TResult
Result type.
- Inheritance
-
MinLengthValidator<TResult>
- Implements
-
IValidator<string, TResult>
- Inherited Members
- Extension Methods
Constructors
MinLengthValidator(int, TResult)
Creates a new MinLengthValidator<TResult> instance.
public MinLengthValidator(int minLength, TResult failureResult)
Parameters
Exceptions
- ArgumentOutOfRangeException
When
minLength
is less than 0.
Properties
FailureResult
Failure result.
public TResult FailureResult { get; }
Property Value
- TResult
MinLength
Expected minimum Length.
public int MinLength { get; }
Property Value
Methods
Validate(string)
Validates the provided obj
.
[Pure]
public Chain<TResult> Validate(string obj)
Parameters
obj
stringObject to validate.
Returns
- Chain<TResult>
Result of
obj
validation.