Interface IValidator<TValidated>
An object which may be used to validate instances of a specified object type and get a validation result.
Namespace: CSF.Validation
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IValidator<TValidated>
Type Parameters
Name | Description |
---|---|
TValidated | The type of object which will be validated. |
Methods
| Improve this Doc View SourceValidateAsync(TValidated, ValidationOptions, CancellationToken)
Validate the specified object instance asynchronously and get a validation result.
Declaration
Task<IQueryableValidationResult<TValidated>> ValidateAsync(TValidated validatedObject, ValidationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TValidated | validatedObject | The object to be validated. |
Validation |
options | An optional object containing configuration options related to the validation process. |
System. |
cancellationToken | An optional object which enables premature cancellation of the validation process. |
Returns
Type | Description |
---|---|
System. |
A task containing the result of the validation process. |
Exceptions
Type | Condition |
---|---|
Validation |
If the validation process fails or errors and the Rule |