Skip to main content

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
Declaration
public class AttributedValidatorFactory : IValidatorFactory, IParameterValidatorFactory

Methods

GetValidator<T>()

Gets a validator for the appropriate type.

View Source
Declaration
public IValidator<T> GetValidator<T>()
Returns

ServiceStack.FluentValidation.IValidator<T>

Type Parameters
  • T

GetValidator(Type)

Gets a validator for the appropriate type.

View Source
Declaration
public virtual IValidator GetValidator(Type type)
Returns

ServiceStack.FluentValidation.IValidator: Created ServiceStack.FluentValidation.IValidator instance; null if a validator cannot be created.

Parameters
TypeName
System.Typetype

GetValidator(ParameterInfo)

Gets a validator for <code data-dev-comment-type="paramref" class="paramref">parameterInfo</code>.

View Source
Declaration
public virtual IValidator GetValidator(ParameterInfo parameterInfo)
Returns

ServiceStack.FluentValidation.IValidator: Created ServiceStack.FluentValidation.IValidator instance; null if a validator cannot be created.

Parameters
TypeNameDescription
System.Reflection.ParameterInfoparameterInfoThe System.Reflection.ParameterInfo instance to get a validator for.

|

Implements