Skip to main content

CustomizeValidatorAttribute

Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public class CustomizeValidatorAttribute : CustomModelBinderAttribute

Properties

RuleSet

Specifies the ruleset which should be used when executing this validator. This can be a comma separated list of rulesets. The string "*" can be used to indicate all rulesets. The string "default" can be used to specify those rules not in an explict ruleset.

View Source
Declaration
public string RuleSet { get; set; }

Properties

Specifies a whitelist of properties that should be validated, as a comma-separated list.

View Source
Declaration
public string Properties { get; set; }

Interceptor

Specifies an interceptor that can be used to customize the validation process.

View Source
Declaration
public Type Interceptor { get; set; }

Skip

Indicates whether this model should skip being validated. The default is false.

View Source
Declaration
public bool Skip { get; set; }

Methods

GetBinder()

View Source
Declaration
public override IModelBinder GetBinder()
Returns

IModelBinder

BindModel(ControllerContext, ModelBindingContext)

View Source
Declaration
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
Returns

System.Object

Parameters
TypeName
ControllerContextcontrollerContext
ModelBindingContextbindingContext

GetFromControllerContext(ControllerContext)

View Source
Declaration
public static CustomizeValidatorAttribute GetFromControllerContext(ControllerContext context)
Returns

ServiceStack.FluentValidation.Mvc.CustomizeValidatorAttribute

Parameters
TypeName
ControllerContextcontext

ToValidatorSelector()

Builds a validator selector from the options specified in the attribute's properties.

View Source
Declaration
public IValidatorSelector ToValidatorSelector()
Returns

ServiceStack.FluentValidation.Internal.IValidatorSelector

CreateRulesetValidatorSelector(String[])

View Source
Declaration
protected virtual IValidatorSelector CreateRulesetValidatorSelector(string[] ruleSets)
Returns

ServiceStack.FluentValidation.Internal.IValidatorSelector

Parameters
TypeName
System.String[]ruleSets

CreateMemberNameValidatorSelector(String[])

View Source
Declaration
protected virtual IValidatorSelector CreateMemberNameValidatorSelector(string[] properties)
Returns

ServiceStack.FluentValidation.Internal.IValidatorSelector

Parameters
TypeName
System.String[]properties

CreateDefaultValidatorSelector()

View Source
Declaration
protected virtual IValidatorSelector CreateDefaultValidatorSelector()
Returns

ServiceStack.FluentValidation.Internal.IValidatorSelector

GetInterceptor()

View Source
Declaration
public IValidatorInterceptor GetInterceptor()
Returns

ServiceStack.FluentValidation.Mvc.IValidatorInterceptor

Implements

  • IModelBinder