Show / Hide Table of Contents

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 Source

GetValidator(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 manifest is null.

ValidatorBuildingException

If the manifest is not valid to create a validator instance.

| Improve this Doc View Source

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 manifestModel is null.

ValidatorBuildingException

If the manifestModel is not valid to create a validator instance.

| Improve this Doc View Source

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 builderType is null.

System.ArgumentException

If the builderType is not a concrete (non-abstract) class derived from IBuildsValidator<TValidated> or if it implements that interface more than once for different generic types.

| Improve this Doc View Source

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.

Extension Methods

ValidatorFactoryExtensions.GetValidator<TValidated>(IGetsValidator, Type)
ValidatorFactoryExtensions.GetValidator<TValidated>(IGetsValidator, ValidationManifest)
ValidatorFactoryExtensions.GetValidator<TValidated>(IGetsValidator, Value)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX