Interface IGetsValidator
An object which may be used as the factory from which to create validator instances.
Namespace: CSF.Validation
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IGetsValidator
Methods
| Improve this Doc View SourceGetValidator(ValidationManifest)
Gets a validator instance using a specified validation manifest. A validation manifest is a model which may specify a validator using data.
Declaration
IValidator GetValidator(ValidationManifest manifest)
Parameters
| Type | Name | Description |
|---|---|---|
| ValidationManifest | manifest | The validation manifest. |
Returns
| Type | Description |
|---|---|
| IValidator | A validator implementation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If the |
| ValidatorBuildingException | If the |
GetValidator(Value, Type)
Gets a validator instance using a specified validation manifest. A validation manifest is a model which may specify a validator using data. This overload uses a simplified/serialization-friendly model.
Declaration
IValidator GetValidator(Value manifestModel, Type validatedType)
Parameters
| Type | Name | Description |
|---|---|---|
| Value | manifestModel | A simplified validation manifest model. |
| System.Type | validatedType | The type of object to be validated. |
Returns
| Type | Description |
|---|---|
| IValidator | A validator implementation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If the |
| ValidatorBuildingException | If the |
GetValidator(Type)
Gets a validator instance using a specified builder type which specifies a validator via code.
Declaration
IValidator GetValidator(Type builderType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | builderType | The type of a class which implements IBuildsValidator<TValidated> for the desired validated type. |
Returns
| Type | Description |
|---|---|
| IValidator | A validator implementation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If the |
| System.ArgumentException | If the |
GetValidator<TValidated>(IBuildsValidator<TValidated>)
Gets a validator instance using a specified validator-builder instance which specifies a validator via code.
Declaration
IValidator<TValidated> GetValidator<TValidated>(IBuildsValidator<TValidated> builder)
Parameters
| Type | Name | Description |
|---|---|---|
| IBuildsValidator<TValidated> | builder | An instance of a validator-builder. |
Returns
| Type | Description |
|---|---|
| IValidator<TValidated> | A strongly-typed validator implementation. |
Type Parameters
| Name | Description |
|---|---|
| TValidated | The type of object to be validated. |