Class OrCompositeValidator<T, TResult>
- Namespace
- LfrlAnvil.Validation.Validators
- Assembly
- LfrlAnvil.Validation.dll
Represents a collection of generic object validators that returns an empty result if any of the underlying validators returns an empty result.
public sealed class OrCompositeValidator<T, TResult> : IValidator<T, OrValidatorResult<TResult>>
Type Parameters
TObject type.
TResultResult type.
- Inheritance
-
OrCompositeValidator<T, TResult>
- Implements
-
IValidator<T, OrValidatorResult<TResult>>
- Inherited Members
- Extension Methods
Constructors
OrCompositeValidator(IReadOnlyList<IValidator<T, TResult>>)
Creates a new OrCompositeValidator<T, TResult> instance.
public OrCompositeValidator(IReadOnlyList<IValidator<T, TResult>> validators)
Parameters
validatorsIReadOnlyList<IValidator<T, TResult>>Underlying validators.
Properties
Validators
Underlying validators.
public IReadOnlyList<IValidator<T, TResult>> Validators { get; }
Property Value
- IReadOnlyList<IValidator<T, TResult>>
Methods
Validate(T)
Validates the provided obj.
[Pure]
public Chain<OrValidatorResult<TResult>> Validate(T obj)
Parameters
objTObject to validate.
Returns
- Chain<OrValidatorResult<TResult>>
Result of
objvalidation.