Skip to main content

IValidator

Defines a validator for a particular type.

Assembly: ServiceStack.dll
View Source
Declaration
public interface IValidator

Methods

Validate(IValidationContext)

Validates the specified instance.

View Source
Declaration
ValidationResult Validate(IValidationContext context)
Returns

ServiceStack.FluentValidation.Results.ValidationResult: A ValidationResult object contains any validation failures.

Parameters
TypeNameDescription
ServiceStack.FluentValidation.IValidationContextcontextA ValidationContext

|

ValidateAsync(IValidationContext, CancellationToken)

Validates the specified instance asynchronously.

View Source
Declaration
Task<ValidationResult> ValidateAsync(IValidationContext context, CancellationToken cancellation = default(CancellationToken))
Returns

System.Threading.Tasks.Task<ServiceStack.FluentValidation.Results.ValidationResult>: A ValidationResult object contains any validation failures.

Parameters
TypeNameDescription
ServiceStack.FluentValidation.IValidationContextcontextA ValidationContext

| | System.Threading.CancellationToken | cancellation | Cancellation token

|

CreateDescriptor()

Creates a hook to access various meta data properties

View Source
Declaration
IValidatorDescriptor CreateDescriptor()
Returns

ServiceStack.FluentValidation.IValidatorDescriptor: A IValidatorDescriptor object which contains methods to access metadata

CanValidateInstancesOfType(Type)

Checks to see whether the validator can validate objects of the specified type

View Source
Declaration
bool CanValidateInstancesOfType(Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype