Skip to main content

IValidatorInterceptor

Specifies an interceptor that can be used to provide hooks that will be called before and after MVC validation occurs.

Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public interface IValidatorInterceptor

Methods

BeforeMvcValidation(ControllerContext, IValidationContext)

Invoked before MVC validation takes place which allows the ValidationContext to be customized prior to validation. It should return a ValidationContext object.

View Source
Declaration
IValidationContext BeforeMvcValidation(ControllerContext controllerContext, IValidationContext validationContext)
Returns

ServiceStack.FluentValidation.IValidationContext: Validation Context

Parameters
TypeNameDescription
ControllerContextcontrollerContextController Context

| | ServiceStack.FluentValidation.IValidationContext | validationContext | Validation Context

|

AfterMvcValidation(ControllerContext, IValidationContext, ValidationResult)

Invoked after MVC validation takes place which allows the result to be customized. It should return a ValidationResult.

View Source
Declaration
ValidationResult AfterMvcValidation(ControllerContext controllerContext, IValidationContext validationContext, ValidationResult result)
Returns

ServiceStack.FluentValidation.Results.ValidationResult: Validation Context

Parameters
TypeNameDescription
ControllerContextcontrollerContextController Context

| | ServiceStack.FluentValidation.IValidationContext | validationContext | Validation Context

| | ServiceStack.FluentValidation.Results.ValidationResult | result | The result of validation.

|