AttributedValidatorFactory
Implementation of ServiceStack.FluentValidation.IValidatorFactory and ServiceStack.FluentValidation.IParameterValidatorFactory that looks for
the ServiceStack.FluentValidation.Attributes.ValidatorAttribute instance on the specified System.Type
or
System.Reflection.ParameterInfo
in order to provide the validator instance.
Assembly: ServiceStack.dll
View Source
public class AttributedValidatorFactory : IValidatorFactory, IParameterValidatorFactory
Methods
GetValidator<T>()
Gets a validator for the appropriate type.
View Source
public IValidator<T> GetValidator<T>()
Returns
ServiceStack.FluentValidation.IValidator<T>
Type Parameters
T
GetValidator(Type)
Gets a validator for the appropriate type.
View Source
public virtual IValidator GetValidator(Type type)
Returns
ServiceStack.FluentValidation.IValidator: Created ServiceStack.FluentValidation.IValidator instance; null
if a validator cannot be
created.
Parameters
Type | Name |
---|---|
System.Type | type |
GetValidator(ParameterInfo)
Gets a validator for <code data-dev-comment-type="paramref" class="paramref">parameterInfo</code>.
View Source
public virtual IValidator GetValidator(ParameterInfo parameterInfo)
Returns
ServiceStack.FluentValidation.IValidator: Created ServiceStack.FluentValidation.IValidator instance; null
if a validator cannot be
created.
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ParameterInfo | parameterInfo | The System.Reflection.ParameterInfo instance to get a validator for. |
|