Share via


ValidatorAttribute.CreateValidator Method

Creates the Validator described by the configuration object.

Namespace: Microsoft.Practices.EnterpriseLibrary.Validation.Validators
Assembly: Microsoft.Practices.EnterpriseLibrary.Validation (in Microsoft.Practices.EnterpriseLibrary.Validation.dll) Version: 6.0.0.0 (6.0.1304.0)

Syntax

protected Validator CreateValidator(
    Type targetType,
    Type ownerType,
    MemberValueAccessBuilder memberValueAccessBuilder,
    ValidatorFactory validatorFactory
)
'Declaration
Protected Function CreateValidator ( 
    targetType As Type,
    ownerType As Type,
    memberValueAccessBuilder As MemberValueAccessBuilder,
    validatorFactory As ValidatorFactory
) As Validator
protected:
Validator^ CreateValidator(
    Type^ targetType, 
    Type^ ownerType, 
    MemberValueAccessBuilder^ memberValueAccessBuilder, 
    ValidatorFactory^ validatorFactory
)

Parameters

  • targetType
    Type: System.Type
    The type of object that will be validated by the validator.
  • ownerType
    Type: System.Type
    The type of the object from which the value to validate is extracted.

Return Value

Type: Validator
The created Validator.

Remarks

Sets the tag and message template to the created validator.

See Also

ValidatorAttribute Class

ValidatorAttribute Members

Microsoft.Practices.EnterpriseLibrary.Validation.Validators Namespace