Table of Contents

Class MinLengthValidator<TResult>

Namespace
LfrlAnvil.Validation.Validators
Assembly
LfrlAnvil.Validation.dll

Represents a string validator that expects a minimum Length.

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

minLength int

Expected minimum Length.

failureResult TResult

Failure result.

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

int

Methods

Validate(string)

Validates the provided obj.

[Pure]
public Chain<TResult> Validate(string obj)

Parameters

obj string

Object to validate.

Returns

Chain<TResult>

Result of obj validation.